Comparison Between Angular 11 vs 12 vs 13 (Detailed)

AngularJS was developed in 2010 with the aim of building interactive web applications and has since gained immense popularity among front-end developers. It is an open-source framework that allows developers to solve many of the problems associated with the development of web applications.

With the JavaScript MVC framework, it is possible to create dynamic web applications with a variety of features. Among the many benefits that it provides to developers, it enables them to develop web applications that are attractive, engaging, and easy to use.

Compared to other JS frameworks, AngularJS offers unique functionalities and advantages. As a result, AngularJS has become one of the most popular frameworks in the world. With its agile development process, the project is able to save a lot of money as well as time on the development side of the project. The bottom line is, as a business owner, if you are thinking about creating a web app but are confused about how to choose the right framework to use, then AngularJS will be the ideal choice to make.

AngularJS is considered a web application development tool that’s always chosen by web owners because of its progressive features. Brands like Guardian, Upwork, Freelancer, JetBlue, PayPal, Netflix, Lego, use AngularJS. So there is no doubt that it is one of the most popular frameworks but people are still confused by the recent release of AngularJS which version should opt for Angular 11 or 12 or 13.

Therefore to clear all your doubts we have done an Angular version comparison and we have tried to differentiate the difference between Angular 11, 12, 13.

Comparison Table of Angular Versions

In our comparison of Angular 11 vs Angular 12 vs Angular 13, we learned about breaking changes, performance, and core structural changes, as well as several additional deprecations and upgrades. Let’s have a look at a table that compares the features offered by each:

Angular v11Angular v12Angular v13
TypeScript 4.0TypeScript 4.2TypeScript 4.4
Webpack 5 SupportWebpack 5.37 SupportWebpack 5.37 Support
Migration to ESLintMigrating from legacy i18n message IDsView Engine is no longer available
Deprecation of IE 9, 10, and IE mobileDeprecating support for IE 11End of IE 11 support
Updates on Operation ByelogImproved component tests harnessImprovements to the Angular CLI
Updated Language Service PreviewUpdated Language Service PreviewImprovements to Angular tests
Strict checks with a flagDefault strict modeFramework changes and dependency updates
Roadmap to provide early feedbackRoadmap to inform about the priorities of the Angular teamSupport to Adobe Fonts
LintingMigration to default IVY-based language serviceChanges to the Angular Package Format (APF)
Improved Ngcc compilerImproved logging and reportingPR merges from community
Updated Hot Module Replacement (HMR) SupportHTTP improvementsComponent API updates

Angular 13

angular 13 specifications
Release date: November 3, 2021

View Engine is No Longer Available

Angular 13 does not support the legacy View Engine. Maintaining View Engine incurs maintenance costs, and Angular 13 codebases are more complex because of it. Angular now supports only Ivy as a view engine so that users do not have to bother with that hassle.

This change will result in the automatic migration of some existing libraries to partial compilation mode, as well as the removal of some metadata, which were previously required by the legacy View Engine. Additionally, all internal tools will be converted to Ivy ahead of time in order to avoid interruptions during the transition.

Changes to Angular Package Format

Angular Framework packages and View Engine metadata are defined by the Angular Package Format (APF). I think this is an excellent method of packaging every third-party library associated with the development of a web project.

The new version of the APF contains some significant changes that are worth noting. There are some older output formats, including some View Engine-specific metadata, that have been removed from Angular 13.

NGCC will no longer be required when APF is updated. This means that developers can now anticipate faster execution as a result of these changes.

IE 11 Support Removed

The Angular team has removed support for Internet Explorer 11 in order to take advantage of web APIs that are native to it, as well as modern features found in modern browsers such as CSS variables and web animations. Because of the absence of IE-specific polyfills and no need for differential loading, this is able to offer a smaller bundle size and faster load time for apps, along with improved user experience.

If you still use IE 11 and have not yet upgraded to Microsoft Edge or any modern browser, this breaking change will certainly pose a problem for any authorities or institutions.

TypeScript 4.4 Support

The latest version of Angular supports TypeScript 4.4. This means that we will be able to take advantage of a variety of language features. Additionally, the latest release does not support TypeScript 4.2 or 4.3.

TypeScript 4.4 introduces a breaking change that is advantageous to Angular applications, that is, it doesn’t implement setters and getters to get similar types anymore, which is a positive change.

Node.js Versions Prior to 12.20 are No Longer Supported

It is no longer possible to use versions of Node.js prior to 12.20.0 with Angular 13. This is because of the fact that the packages for Angular now use the package export features from Node.js using subpath patterns.

RxJS Version 7.4

RxJS is a reactive extension for JavaScript. There are various versions of RxJS included in the Angular 13 upgrade, including versions up to and including version 7.

Now, RxJS 7.4 is the default when apps are created with ng new.

It is necessary to update existing RxJS v6.x applications manually through the use of the npm install rxjs@7.4 command. You can, however, create new projects using RxJS 7 in any case. If you are already working with RxJS 6, then you should continue to do so.

Router Changes

The routing system allows us to move from one view to another. By interpreting the URL in the browser as a request to change the view, it simplifies navigation.

A router no longer changes the browser URL which is navigation cancels the current navigation after the newest update.

A number of problems were encountered with compatibility with previous versions of Angular, most notably query parameters. When you put a question mark in a query parameter, the default URL serializer drops everything. On the other hand, the latest update makes query parameters compatible with question marks. 

Annul or undefined input to a router link detective was equivalent to an empty string, and it could be navigated as before. In order to prevent full navigation, the values for the link directive variables should always be null or undefined.

Angular CLI Enhancements

A crucial part of Angular is the CLI. Angular CLI simplifies the process of managing web development’s difficulties by reducing complexity across the board.

As part of the release of Angular 13, the framework now comes with a persistent build-cache, which means you can use it for your built-in results, saving them to the disc as a default feature. It is as a result of this that the growth and development process will be accelerated. As a result, you get to choose whether or not you would like this feature to be enabled and disabled in current Angular projects.

Time for Debugging and Testing has been Improved

Angular applications and libraries that are internal to the framework use TestBed as their unit testing API.

TestBed’s new version has been released with improved test API in order to decrease test time. With the new framework, the test environment can now be set up and down automatically and the DOM can now be learned automatically after each test cycle. Therefore, tests are faster and less resource-intensive, and they are more isolated.

Ergonomic APIs

Angular v13 has proven a considerable improvement in load performance due to its ergonomic code-splitting APIs and granular disruption of code at the component level. Additionally, ESBuild has improved performance as well.

ESBuild is a JavaScript bundler that is incredibly fast. As of now, it also works in conjunction with Terser to optimize worldwide scripts. Furthermore, it also supports CSS source maps, which allow it to optimize globally as well. Additionally, this bundler provides support for other framework languages like Vue, Svelte, and Elm in addition to the JavaScript language.

Accessibility Update in Angular Material

Accessibility (A11y) has been improved in Angular Material: all Material Design Components (MDCs) have been reviewed in order to make them more accessible. Among these changes are the larger sizes of checkboxes and radio buttons, along with improved high contrast modes for other components.

New Type of Forms

In Angular 13 an entirely new type for forms has been introduced, which is FormControlStatus. Basically, it represents a union of all the possible status strings for form controls:

  • Instead of String containing the AbstractControl.status, AbstractControl will be now  FormControlStatus.
  • Instead of observable<any>, StatusChanges are observable<FormControlStatus>.

Inline support for Adobe Fonts

As part of Angular’s upgrade to version 13, Adobe fonts will be supported inline, as well. An app’s functionality can be boosted by using these fonts by accelerating the FCP (First Contentful Paint). The good news is that this change is now available to everyone by default. You do not have to do anything other than to run ng update.

Improvement in Localization

Developers have the ability to use the $localize API to provide a better approach for tagging messages, i18n, and in-built translations. For instance, codes are translated and templates are translated using the $localize API.

Component API Updates

Using Ivy, developers can also dynamically create components and enjoy their work more. The previous complex APIs have now been simplified. Angular v13 made it easy to dynamically create components without having to write too much boilerplate code prior to the changes.

With the new API, ComponentFactoryResolver does not need to be injected into constructors. Ivy provides the ability to create a component directly without configuring an associated factory with ViewContainerRef.createComponent.

In the following example you can see how to create a component using Angular’s previous versions:

@Directive({ … })
export class MyDirective {
constructor(private viewContainerRef: ViewContainerRef,
private componentFactoryResolver:
ComponentFactoryResolver) {}
createMyComponent() {
const componentFactory = this.componentFactoryResolver.
resolveComponentFactory(MyComponent);
this.viewContainerRef.createComponent(componentFactory);
}
}

If you use the new API, you can make the following changes:

@Directive({ … })
export class MyDirective {
constructor(private viewContainerRef: ViewContainerRef) {}
createMyComponent() {
this.viewContainerRef.createComponent(MyComponent);
}
}

Angular 12

angular 12 specifications
Release date: May 12, 2021

Ivy Everywhere

A new step is being taken in the Angular revolution with the release of Angular 12.

Ivy Everywhere is finally a reality as part of the Angular team’s decision to deprecate View Engine. Currently available libraries that incorporate the View Engine will continue to function properly with Ivy applications. However, with the release of Angular 12, it is past time for library developers to begin planning their migration to Ivy.

Transitioning from Legacy i18n Message IDs

Legacy message-ids encounter complications with whitespace and the i18n framework’s organizational formats and ICU expressions. To address this issue, the Angular team is strengthening and improving the standard message-id design. This setting will cut down on the invalidation of extra translations and the cost of retranslating them in applications where translations don’t stay organized because of whitespace changes.

Since Angular version 11, new tasks make use of new message ids, and they now provide tooling for migrating existing projects with existing translations. Angular 12 includes critical tools for translation migration.

Adios Protractor

Angular is compatible with a number of different technologies, including Cypress, WebdriverIO, and TestCafe. The future of Protractor appeared to be in jeopardy. Protractors, on the other hand, will no longer be provided in future versions of Angular applications. 

Nullish Coalescing

This updated version features a nullish coalescing operator (??) that allows you to write conditional code that is easier to understand. Update your Angular application and take advantage of the operator to simplify the process of writing conditional statements. Because this TypeScript operator has been in use for a long period of time, its inclusion in Angular boosts its usefulness for the thousands of developers who already use it.

Styling Improvements

To begin, the component decorator-style field now supports inline Sass in addition to the previous support. Additionally, Angular Material and Angular CDK now make use of a new Sass module system that has been developed internally by Google. Finally, support for Tailwind CSS has been added to angular 12.

Minified UMDs, redirected source files, strict null checks, an emit event option, HTTP status codes, and support for Webpack 5 are also included in Angular 12.

Deprecating Support for IE11

We are nearing the end of the life cycle of Internet Explorer, and supporting IE has not been easy when creating for the web in the past. The Microsoft team said earlier this year that Microsoft 365 products such as Teams would be ceasing support for Internet Explorer 11 and that the company plans to completely phase out IE from its ecosystem within one year of that announcement.

Angular is also going toward abandoning support for outdated browsers such as Internet Explorer. Starting with this new version of Angular, a new deprecation warning message will be supplied for IE11.

ng API Improvements

An additional feature in Angular 12 is the ng troubleshooting API, which is accessible through the programmer’s development tool. In order to debug APIs for structural analysis of programs, several features, most notably getDirectiveMetadata and esetProfiler, have been added to the library. To access information about components and directives, the getDirectiveMetadata method can be utilized.

To keep track of how long it takes to create templates, execute lifecycle hooks, and modify templates, the esetProfiler is a useful tool to have on your computer. The API can give information on how apps are operating at the moment of use.

Typescript 4.2

It is one of the most major enhancements to the features of Angular 12 that the addition of Typescript 4.2 support has been included. On the 23rd of February, the stable version of the software was made accessible. 

It is this version that introduces a number of new features and important changes. Using this version, we can find out the new features of Typescript 4.2 and how will it affect developers working with Angular 12.

Easy Learning Curve Path

Google is constantly working to improve the developer learning experience. The documentation has been significantly updated as part of angular 12’s latest features. Additionally, they revised the angular.io contributor’s content projection manual, which will assist developers in improving the documentation for their projects.

One of the changes that resulted from the documentation development process is the addition of instructions and movies for error messages. The community has deemed this really cool.

Strict CLI Mode

Strict mode is enabled by default in the Angular 12 Command Line Interface (CLI). Developers will be able to spot problems in a project earlier in the development cycle as a result of this.

This mode improves maintainability while also making it easier to evaluate apps in a static environment. Additionally, when updating apps to the most recent version of Angular, the CLI mode can assist the ng update command in more safely and properly restructuring code, which is beneficial.

Default Production Build

The development build had been enhanced by running the ng build command. NG build will now default to producing production builds in version 12. This will prevent development builds from accidentally being deployed to production.

Removal of Unused Methods from DomAdapter

Every Angular application has this feature. In the Angular 12 version that has been released, some of the unused methods have been removed. The following methods are no longer available:

  • getProperty
  • supportsCookies 
  • log
  • getCookie
  • logGroup and logGroupEnd
  • getLocation and getHistory
  • performanceNow

Angular 11

angular 11 specifications
Release date: November 11, 2020

Updated Hot Module Replacement (HMR) Support

Although Angular’s hot module replacement capability has been available for some time now, using it in a new Angular project would require some program change which would make it not very simple to use as a component in new Angular applications. It was necessary for the CLI to be updated for this new version to be able to handle HMR from the jump when using ng serve in the following way:

ng serve –hmr

The following message will appear after your app has been launched telling you that your HMR is activated. Keep in mind as well that you will only be able to access this function on the development server. The benefit of this is that as you build, all the changes you make to your components, templates, and styles will automatically reflect in your app as you run the app without forcing you to refresh your page.

Updates on Operation Byelog

To begin, it’s Operation Byelog, during which the angular team spent significant engineering time triaging problems and reviewing PRs, before delivering a quality release based on a thorough understanding of the group’s requirements. Therefore, we can now confirm that the initial target has been met.

The three mono repo now have all the issues triaged and will continue to do so as new issues are reported. Additionally, this process has addressed concerns regarding the router and forms (see below). Additionally, all issues now get handled within two weeks of the occurrence, which has significantly reduced the backlog for the Angular team and has resolved a number of issues.

Automatic Inlining of Fonts

There have been some optimization updates. The very first contentful painting in your app will now be inlined automatically. As a result, when you run Angular’s ng serve command, Angular will now download and integrate fonts in the project that are used or linked so that your project is rendered even faster as a result of this. With this update, you can use it right out of the box with Angular 11, so make sure you update your version.

If you are running a build on CI, then all that you need to do is ensure that the internet is accessible during the build process in order to take advantage of this optimization.

"configurations": {
"optimization": true
}
You can disable this optimisation by changing the flag to below snippets
"configurations": {
"optimization": {
"fonts": false
}
}

OR

"configurations": {
"optimization": {
"fonts": {
"inline": false
}
}
}

Component Test Harness

In the Angular 9 framework, the component test harness was introduced for the first time. In addition, it is well known for providing a legible and robust API surface that is helpful for testing Angular Material. As a result, it provides Angular developers with an excellent way to interact with the Angular material component while they are testing. It is likely that APIs will interact with the components in the same way that end users would, and the test will be able to isolate themselves from the changes to the DOM.

All components have been harnessed in the most recent version of Angular. As a result, developers are able to test the application more easily. It is now possible for developers to create more robust test suites with the updates and harnesses released for all components.

Aside from the amazing features, the API itself has undergone significant improvements, including improved performance.

As a result, developers can now better handle the asynchronous actions in the tests by making use of the parallel function, which allows them to run multiple tests asynchronously. As a result, developers can perform multiple actions simultaneously, saving them a significant amount of time. This function also detects changes.

When automatic change detection is disabled in unit tests, you can use ManualChangeDetection to adjust the scale in which changes are detected. The more complicated scenarios can be certified in this way. As stated in the official doc,  Angulars’ change detection will be run prior to reading and interacting with a DOM element in the test harnesses.

Updated Language Service Preview

It provides developers with an improved experience. TypeScript’s language service is now capable of detecting generic type sin templates, just like it does with TypeScript. As of now, the feature is still in development, however, once it is rolled out properly, it will provide you with a great advantage.

The Angular Language Service is an important tool because it allows developers to work on Angular while still being productive. In the previous version of angular, the Language service is based on the view engine, while the latest version provides Ivy-based language functionality, which is much more dynamic and precise.  

Faster Builds

A number of the critical areas will be able to speed up their development with the Angular 11 updates. After dependency installation, the ngcc process of updating should become three or four times faster once the dependencies are installed. Also, you can expect a faster compilation of TypeScript v4.0.

Experimental Webpack 5 Support

An important feature of Webpack is that it compiles a large volume of files into a single file. A new and more advanced version of Webpack 5 was recently released. The current version is still somewhat unstable.

Angular 11, on the other hand, would give you experimental Webpack 5 support, which means that you can experiment with other features. As a result of the release, Angular can offer even more experimental support, along with faster development and smaller bundles.

Moving to ESLint

Linting was implemented as part of the client implementation in previous versions of Angular. Apparently, it was the most common lint tool for a long time. It has been deprecated to use TSLint and Codelyzer in version 11 of Angular. 

We will no longer be able to provide the default implementation for Linting Angular projects once the update is released. According to the Angular team, migration to ESLint is strongly recommended. In addition, it has also been tested to ensure that developers using Angular will experience a smooth transition.

Router

In previous versions, there was concern that future and next routes might be traded for child routes when using RouteReuseStrategy #shouldReuseRoute method in the RouteReuseStrategy class. This concern has been alleviated in Angular 11. In fact, you need to make sure that your code is adjusted if you are already using it in your code.

A variable of type NavigationExtras can be passed in as a parameter, but object literals are not allowed, as they can only specify types that do not share the same properties as the Pick. For this issue to be resolved, users can use properties from NavigationExtras that use a type assertion on the object or variable: as NavigationExtras.

Forms

Updates for Angular 11 added support for asyncValidators and validators, which were previously inaccessible. Angular 11 contains a null in the AbstractFormControl.parent class. It is now an option in Migration version 11 to assert when there is a non-null value. It used to be that FormControl, FormGroup, and FormArray classes had async validators when they were initialized but that is no longer the case. It is worth pointing out that the status event is emitted into the status changes observable in the new edition.

Improved Reporting and Logging

Furthermore, Angular’s latest version also includes a number of improvements regarding the way in which the building status of your application is reported during the development phase. The CLI has been improved in order to make it easier for people to view logs and even reports by providing easy-to-learn prompts and other improvements.

Roadmap

A roadmap has been updated by the Angular team in order to keep you informed of current priorities. In this post, you will find some announcements about projects in progress that are updated from the roadmap. As a result, it reflects the ability to roll out large efforts incrementally and allows developers to deliver feedback as early as possible so that it may make its way into the final version of the product.

Housekeeping

A major change in Angular 11 is the removal of support for IE9/IE10 and IE mobile. Angular will only support IE11, the last version of Internet Explorer that is still supported. Furthermore, APIs have been removed as well as a few have been added to the list of APIs that have been removed. Make sure you take a look at the following link to make sure you are using the latest APIs and following best practices.

TypeScript 4.0 Support

The Angular team has decided to remove support for TypeScript 3.9 with this latest update. With the release of Angular 11, TypeScript 4.0 will only be supported. It is due in part to the fact that it will make the process of building applications more rapid. The new version of Angular 11 ensures a faster build time.

Supports Lazy Loading with Named Outlets

It is very important to note that until now, named outlets have always supported the component, but it was not possible to lazy load it using named outlets. However, in the latest version of Angular, Angular 11, you will be able to use this tool easily as well as conveniently.

const routes: Routes = [
{
path: 'items',
loadChildren: () => import('./items/items.module').then(m => m.ItemsModule)
}
];

How to Update the Latest version of Angular?

Angular 11 vs 12 vs 13 Features Updates and Comparison update 1024x397 1

Upgrade Angular CLI Globally

Start by running the following command to check which version of Angular CLI you are using. This command will be able to display the version of the Angular project if you run it inside the Angular project directory. If you run it outside of the Angular CLI version, you will end up with the global version of the CLI for Angular.

ng version

In addition to Angular CLI being installed globally, it is also installed per project. The Angular CLI version shall only be upgraded relative to the version in the Angular project if you update the Angular CLI version within the Angular project. In order to upgrade the global Angular CLI version, the previous version is removed and the newer version is installed.

npm uninstall -g @angular-cli
npm install -g @angular/cli@latest

As soon as you have completed the global upgrade of Angular CLI, you can create a new Angular project by using the following command:

ng new

Upgrade Angular Version Using Command

Angular CLI can be used to upgrade an older project to the latest version of Angular using the following commands:

ng update @angular/cli @angular/core

This command will not work unless the project folder is node_modules. Angular’s official website provides more details about the ng update command.

Which version of Angular is best?
The best version of Angular can vary depending on your specific needs and the features you require.
  • Newer versions, like Angular 13, typically contain the latest improvements and fixes.
  • Angular 12 introduced updates including TypeScript 4.2 support, performance enhancements, service worker updates, and Ivy improvements.
  • Performance differences exist between versions; newer versions often have performance improvements over older ones.
However, the best version for you would depend on compatibility with your project, stability, and the features you require.
What is the difference between Angular 11 and 12?
Angular 12 introduced several updates and improvements over Angular 11. Some key changes include:
  • TypeScript 4.2 Support: Angular 12 might have enhanced support for TypeScript 4.2.
  • Performance Improvements: Angular 12 could offer performance enhancements in terms of build and compilation times.
  • Service Worker Updates: Improvements to the Angular service worker functionality.
  • Ivy Improvements: Further enhancements to the Ivy compiler and runtime.
Which is the performing version of Angular?
Angular 13 might have some performance enhancements over Angular 12, and Angular 11. However, the exact differences in performance can be specific to your use cases, required optimizations, and the complexity of the application.

Which Angular Version is better?

If you read the above comparison between Angular version 11 vs Angular 12 vs Angular 13, you are probably interested to know which one is better. Each version has its own advantages, reach, and features. However, if you want to opt for an enhanced, updated, and newest version, then Angular 13 is the right choice for you.

In addition to new features, Angular 11 and Angular 12 differ in their core structures, as well as various upgrades. Another major difference is in TypeScript. While Angular 11 is based on TypeScript 4.0, Angular 12 is based on TypeScript 4.2. Additionally, Angular 12 has removed support for IE11 and default strict mode.

No matter what, you will get that choice of answer clearly while availing of AngularJS development services from a leading development partner like WPWeb Infotech. Our in-house team of experienced AngularJS developers can build enterprise-level web and mobile app solutions using the latest version of Angular in a cost-effective way. 

author
Jigar Shah is the Founder of WPWeb Infotech - a leading Web Development Company in India, USA. Being the founder of the company, he takes care of business development activities and handles the execution of the projects. He is Enthusiastic about producing quality content on challenging technical subjects.

Leave a comment