BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Angular 10, an Incremental Update

Angular 10, an Incremental Update

This item in japanese

Bookmarks

Angular 10 is the next major release of Google's SPA framework. It's a relatively small release that focuses on bug fixes, improved tooling, and dependency updates.

While there are very few visible changes to Angular 10, the team has made some significant updates behind the scenes.

As Angular projects grow ever bigger, it can often become harder to maintain them. To help developers deal with an ever-growing code base, the Angular team added a new 'strict' flag that enforces additional rules aimed at catching bugs earlier and making projects more maintainable.

The new flag can either be used when generating a new project (ng new --strict) or by adding 'strict: true' to tsconfig.base.json.

Enabling the strict flag will have the following effects on the project:

  1. Enabling strict mode in TypeScript
  2. Turning template type checking to Strict
  3. Default bundle budgets being reduced by ~75%
  4. Configures linting rules to prevent declarations of type any
  5. Configuring your app as side-effect free to enable more advanced tree-shaking

It's particularly important to note that developers will no longer be able to use the 'any' type (implicitly or explicitly) after enabling the new flag. While this is considered a good practice, it can prove challenging to convert existing projects to this new standard.

Angular 10 also drops support for several older browsers, including Internet Explorer 9, 10, and Internet Explorer Mobile. Since the deprecated browsers are no longer supported by their vendors and have a marginal market share (combined usage of under 0.2% according to Statcounter), the effect on existing projects should be minimal.

Following these changes, the default browser configuration has also been updated. It no longer includes older and less used browsers, leaving support for the latest versions of Chrome, Edge, Firefox, and Safari. As a side effect, ES5 support is no longer generated by default.

Developers who still need to support the removed browsers can always do so by updating the .browserlistrc file.

Finally, Angular 10 includes the following dependency updates:

  • TypeScript 3.9
  • TSLib v2.0
  • TSLint v6

In order to upgrade existing projects to Angular 10, simply run the following command:

ng update @angular/cli @angular/core

You can read more about the Angular 10 release in the official blog post, or just go directly to the upgrade guide for detailed upgrade instructions.

Angular is open source software available under the MIT license. Contributions are welcome via the Angular Github repository.

Rate this Article

Adoption
Style

BT