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:
- Enables strict mode in TypeScript
- Turns template type checking to Strict
- Default bundle budgets have been reduced by ~75%
- Configures linting rules to prevent declarations of type any
- Configures your app as side-effect free to enable more advanced tree-shaking
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-picker components. See this example on StackBlitz.
Keeping Up to Date with the 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.
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
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
valueChangesevent only once per value change (as opposed to twice in some cases)
maxLengthvalidators only validate values that have a numeric
- Templates with unknown property bindings or unknown element names now log errors instead of warnings
UrlMatchercan now return
- Transplanted views now refresh at insertion point only.
- Formatting times with the
Bformat 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.
ng update @angular/cli @angular/core