Angular

What is new in Angular 10?

Today Angular Teams has announced Version 10.0.0 of Angular! This release is smaller than typical, but it covers the entire platform, including the framework, Angular Material, and the CLI.

What’s new here?

Optional Stricter Settings

ng new --strict

Enabling this flag initializes your new project with a few new settings that improve maintainability, help you catch bugs ahead of time, and allow the CLI to perform advanced optimizations on your app. Specifically, the strict flag does the following:

Warnings about CommonJS imports

When you use a dependency that is packaged with CommonJS, it can result in larger slower applications. Starting from this version, it will now warn you when your build pulls in one of these bundles. If you’ve started seeing these warnings for your dependencies, let your dependency know that you’d prefer an ECMAScript module (ESM) bundle.

New Date Range Picker

Angular Material now includes a new date range picker.

To use the new date range picker, you can use the mat-date-range-input and mat-date-range-picker components. See this example on StackBlitz.

Keeping Up to Date with the Ecosystem

As usual, they have made a few updates to the dependencies of Angular to stay synchronized with the JavaScript ecosystem.

They have also updated our project layout. Starting with version 10 you will see a new tsconfig.base.json. This additional tsconfig.json file better supports the way that IDEs and build tooling resolve type and package configurations.

New Default Browser Configuration

They’ve updated the browser configuration for new projects to exclude older and less used browsers.

v10 Defaults

This has the side effect of disabling ES5 builds by default for new projects. To enable ES5 builds and differential loading for browsers that require it (such as IE or UC Browser), simply add the browsers you need to support in the .browserslistrc file.

New Breaking Changes

  • Typescript 3.6, 3.7, and 3.8 are no longer supported. Please update to Typescript 3.9.
  • Input fields of type number fire the valueChanges event only once per value change (as opposed to twice in some cases)
  • The minLength and maxLength validators only validate values that have a numeric length property
  • Templates with unknown property bindings or unknown element names now log errors instead of warnings
  • UrlMatcher can now return null values
  • Transplanted views now refresh at insertion point only.
  • Formatting times with the b or B format codes now supports time periods that cross midnight.
  • Navigation is canceled for routes with at least one empty resolver.

How to update to version 10

Visit update.angular.io for detailed information and guidance. To have the best update experience, we recommend always upgrading one major release at a time.

To update:

ng update @angular/cli @angular/core

Article Reference:

angular.io

next.angular.io

 

Leave a Reply