feat(@angular/cli): officially support Node.js v16 by clydin · Pull Request #21854 · angular/angular-cli

@clydin added the target: major

This PR is targeted for the next major release

label

Oct 1, 2021

@clydin clydin marked this pull request as ready for review

October 5, 2021 14:20
A full E2E test job is now performed on the main branch using Node.js v16. Node.js v16 is scheduled to become LTS prior to the v13 final release.
Node.js v16 will be entering an LTS state prior to the release of Angular v13 which allows Node.js v16 to be marked as officially supported by the Angular CLI. The initial bootstrapping check now adds Node.js v16 to the output message in the event of an unsupported Node.js version.
NOTE: Prior to the final v13 release, the Node.js v16 minor should be updated to the actual LTS version once available.
Node.js v16's `fs.rmdirSync` will now throw an `ENOENT` error if the path does not exist. `fs.rmSync` is now the preferred option when using Node.js v16 but since this function is not available on Node.js v12 both are tried with `fs.rmSync` given preference.
…`NodeJsAsyncHost` delete operation

The `NodeJsSyncHost`/`NodeJsAsyncHost` classes' `delete` method uses `fs.rmdirSync`/`fs.rmdir` to delete directories. However, Node.js v16's `fs.rmdirSync`/`fs.rmdir` will now throw an `ENOENT` error if the path does not exist. `fs.rmSync`/`fs.rm` is now the preferred option when using Node.js v16 but since this function is not available on Node.js v12 both are tried with `fs.rmSync`/`fs.rm` given preference.
Once Node.js 12 support is dropped, the `delete` method could potentially be refactored to avoid the `isDirectory` check and only use `fs.rmSync`/`fs.rm` which supports both files and directories.
Node.js v16's `fs.rmdir` will now throw an `ENOENT` error if the path does not exist. `fs.rm` is now the preferred option when using Node.js v16 but since this function is not available on Node.js v12 both are tried with `fs.rm` given preference.
… v16

Node.js v16's `fs.rmdir` will now throw an `ENOENT` error if the path does not exist. `fs.rm` is now the preferred option when using Node.js v16 but since this function is not available on Node.js v12 both are tried with `fs.rm` given preference.
In the case of the update command, the usage was guarded by a try/catch block with the downside of leaving the `fs.rmdir` being that a deprecation warning would be shown when running the command which is not ideal.

@clydin

The `material-design-icons` package has not been updated in 5 years and is a large package (40+MB) that frequently causes CI flakes. The recommended method to including the Material design icons is with the Google Fonts API via a index HTML link element (allows for font inlining during production builds). As a result, this test has now been removed.

alan-agius4

@clydin clydin deleted the ci/add-node-v16 branch

October 6, 2021 11:17

devversion added a commit to devversion/angular that referenced this pull request

Oct 6, 2021
This commit updates the `node` engines range for all Angular
framework packages to:

* No longer support NodeJS v12 `< 12.20`. This is done because APF v13
  uses package export patterns which are only supported as of v12.20.
  https://nodejs.org/api/packages.html#packages_subpath_patterns.

* Allows for the latest v16 NodeJS versions. This matches with the CLI
  which added NodeJS v16 support with angular/angular-cli#21854.

  We already limit this to `>= v16.10.0` in preparation to only
  supporting the LTS minors of Node v16.

BREAKING CHANGE: NodeJS versions older than `v12.20.0` are no longer
supported due to the Angular packages using the NodeJS package exports
feature with subpath patterns.

dylhunn pushed a commit to angular/angular that referenced this pull request

Oct 6, 2021
This commit updates the `node` engines range for all Angular
framework packages to:

* No longer support NodeJS v12 `< 12.20`. This is done because APF v13
  uses package export patterns which are only supported as of v12.20.
  https://nodejs.org/api/packages.html#packages_subpath_patterns.

* Allows for the latest v16 NodeJS versions. This matches with the CLI
  which added NodeJS v16 support with angular/angular-cli#21854.

  We already limit this to `>= v16.10.0` in preparation to only
  supporting the LTS minors of Node v16.

BREAKING CHANGE: NodeJS versions older than `v12.20.0` are no longer
supported due to the Angular packages using the NodeJS package exports
feature with subpath patterns.

PR Close #43740