Skip to content

Commit 5bf7022

Browse files
clydinalan-agius4
authored andcommitted
fix(@angular-devkit/build-angular): remove support for Node.js v16
BREAKING CHANGE: Node.js v16 support has been removed Node.js v16 is planned to be End-of-Life on 2023-09-11. Angular will stop supporting Node.js v16 in Angular v17. For Node.js release schedule details, please see: https://github.com/nodejs/release#release-schedule
1 parent c7d1291 commit 5bf7022

File tree

12 files changed

+26
-49
lines changed

12 files changed

+26
-49
lines changed

.circleci/dynamic_config.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ parameters:
2525
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
2626
var_1: &cache_key v1-angular_devkit-16.14-{{ checksum "yarn.lock" }}
2727
var_1_win: &cache_key_win v1-angular_devkit-win-16.14-{{ checksum "yarn.lock" }}
28-
var_3: &default_nodeversion '16.14'
29-
var_3_major: &default_nodeversion_major '16'
28+
var_3: &default_nodeversion '18.13'
29+
var_3_major: &default_nodeversion_major '18'
3030
# The major version of node toolchains. See tools/toolchain_info.bzl
3131
# NOTE: entries in this array may be repeated elsewhere in the file, find them before adding more
32-
var_3_all_major: &all_nodeversion_major ['16', '18']
32+
var_3_all_major: &all_nodeversion_major ['18']
3333
# Workspace initially persisted by the `setup` job, and then enhanced by `setup-and-build-win`.
3434
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
3535
# https://circleci.com/blog/deep-diving-into-circleci-workspaces/
@@ -141,8 +141,8 @@ commands:
141141
setup_windows:
142142
steps:
143143
- initialize_env
144-
- run: nvm install 16.14.2
145-
- run: nvm use 16.14.2
144+
- run: nvm install 18.13.0
145+
- run: nvm use 18.13.0
146146
- run: npm install -g [email protected] @bazel/bazelisk@${BAZELISK_VERSION}
147147
- run: node --version
148148
- run: yarn --version
@@ -299,15 +299,15 @@ jobs:
299299
PWD: .
300300
command: |
301301
mkdir X:/ramdisk/e2e
302-
bazel test --define=E2E_TEMP=X:/ramdisk/e2e --define=E2E_SHARD_TOTAL=$env:CIRCLE_NODE_TOTAL --define=E2E_SHARD_INDEX=$env:CIRCLE_NODE_INDEX --config=e2e //tests/legacy-cli:e2e.npm_node16
302+
bazel test --define=E2E_TEMP=X:/ramdisk/e2e --define=E2E_SHARD_TOTAL=$env:CIRCLE_NODE_TOTAL --define=E2E_SHARD_INDEX=$env:CIRCLE_NODE_INDEX --config=e2e //tests/legacy-cli:e2e.npm_node18
303303
# This timeout provides time for the actual tests to timeout and report status
304304
# instead of CircleCI stopping the job without test failure information.
305305
no_output_timeout: 40m
306306
- fail_fast
307307
- store_artifacts:
308-
path: dist/testlogs/tests/legacy-cli/e2e.npm_node16
308+
path: dist/testlogs/tests/legacy-cli/e2e.npm_node18
309309
- store_test_results:
310-
path: dist/testlogs/tests/legacy-cli/e2e.npm_node16
310+
path: dist/testlogs/tests/legacy-cli/e2e.npm_node18
311311

312312
workflows:
313313
version: 2

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
defaultVersion: 16
8080
strategy:
8181
matrix:
82-
version: [16, 18]
82+
version: [18]
8383
steps:
8484
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
8585
with:
@@ -105,7 +105,7 @@ jobs:
105105
strategy:
106106
matrix:
107107
os: [ubuntu-latest]
108-
node: [16, 18]
108+
node: [18]
109109
subset: [npm, yarn, esbuild]
110110
shard: [0, 1, 2, 3]
111111
exclude:

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.10.0
1+
18.13.0

WORKSPACE

+1-6
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ rules_pkg_dependencies()
5151
# Setup the Node.js toolchain
5252
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
5353

54-
nodejs_register_toolchains(
55-
name = "node16",
56-
node_version = "16.14.2",
57-
)
58-
5954
nodejs_register_toolchains(
6055
name = "node18",
6156
node_version = "18.13.0",
@@ -64,7 +59,7 @@ nodejs_register_toolchains(
6459
# Set the default nodejs toolchain to the latest supported major version
6560
nodejs_register_toolchains(
6661
name = "nodejs",
67-
node_version = "18.10.0",
62+
node_version = "18.13.0",
6863
)
6964

7065
load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")

constants.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Engine versions to stamp in a release package.json
2-
RELEASE_ENGINES_NODE = "^16.14.0 || >=18.10.0"
2+
RELEASE_ENGINES_NODE = ">=18.13.0"
33
RELEASE_ENGINES_NPM = "^6.11.0 || ^7.5.6 || >=8.0.0"
44
RELEASE_ENGINES_YARN = ">= 1.13.0"
55

docs/DEVELOPER.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ To get started locally, follow these instructions:
66

77
1. If you haven't done it already, [make a fork of this repo](https://github.com/angular/angular-cli/fork).
88
1. Clone to your local computer using `git`.
9-
1. Make sure that you have Node `v14.20`, `v16.14` or `v18.10` installed. See instructions [here](https://nodejs.org/en/download/).
9+
1. Make sure that you have Node `v18.13` or higher installed. See instructions [here](https://nodejs.org/en/download/).
1010
1. Make sure that you have `yarn` installed; see instructions [here](https://yarnpkg.com/lang/en/docs/install/).
1111
1. Run `yarn` (no arguments) from the root of your clone of this project to install dependencies.
1212

@@ -86,8 +86,8 @@ You can find more info about debugging [tests with Bazel in the docs.](https://g
8686
### End to end tests
8787

8888
- For a complete list of test targets use the following Bazel query: `yarn bazel query "tests(//tests/...)"`
89-
- Run a subset of the tests: `yarn bazel test //tests/legacy-cli:e2e_node16 --test_filter="tests/i18n/ivy-localize-*"`
90-
- Use `bazel run` to debug failing tests debugging: `yarn bazel run //tests/legacy-cli:e2e_node16 --test_arg="--glob=tests/basic/aot.ts"`
89+
- Run a subset of the tests: `yarn bazel test //tests/legacy-cli:e2e_node18 --test_filter="tests/i18n/ivy-localize-*"`
90+
- Use `bazel run` to debug failing tests debugging: `yarn bazel run //tests/legacy-cli:e2e_node18 --test_arg="--glob=tests/basic/aot.ts"`
9191
- Provide additional `e2e_runner` options using `--test_arg`: `--test_arg="--yarn"`
9292

9393
When running the debug commands, Node will stop and wait for a debugger to attach.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"url": "https://github.com/angular/angular-cli.git"
4040
},
4141
"engines": {
42-
"node": "^16.14.0 || ^18.10.0",
42+
"node": "^18.13.0",
4343
"yarn": ">=1.21.1 <2",
4444
"npm": "Please use yarn instead of NPM to install dependencies"
4545
},
@@ -101,7 +101,7 @@
101101
"@types/karma": "^6.3.0",
102102
"@types/less": "^3.0.3",
103103
"@types/loader-utils": "^2.0.0",
104-
"@types/node": "^16.11.7",
104+
"@types/node": "^18.13.0",
105105
"@types/node-fetch": "^2.1.6",
106106
"@types/npm-package-arg": "^6.1.0",
107107
"@types/pacote": "^11.1.3",

packages/angular/cli/bin/ng.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,13 @@ if (version[0] % 2 === 1) {
5555
);
5656

5757
require('./bootstrap');
58-
} else if (
59-
version[0] < 14 ||
60-
(version[0] === 14 && version[1] < 20) ||
61-
(version[0] === 16 && version[1] < 14) ||
62-
(version[0] === 18 && version[1] < 10)
63-
) {
64-
// Error and exit if less than 14.20, 16.14 or 18.10
58+
} else if (version[0] < 18 || (version[0] === 18 && version[1] < 13)) {
59+
// Error and exit if less than 18.13
6560
console.error(
6661
'Node.js version ' +
6762
process.version +
6863
' detected.\n' +
69-
'The Angular CLI requires a minimum Node.js version of either v14.20, v16.14 or v18.10.\n\n' +
64+
'The Angular CLI requires a minimum Node.js version of v18.13.\n\n' +
7065
'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
7166
);
7267

packages/angular/cli/lib/cli/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { writeErrorToLogFile } from '../../src/utilities/log-file';
1616

1717
export { VERSION } from '../../src/utilities/version';
1818

19-
const MIN_NODEJS_VERSION = [16, 13] as const;
19+
const MIN_NODEJS_VERSION = [18, 13] as const;
2020

2121
/* eslint-disable no-console */
2222
export default async function (options: { cliArgs: string[] }) {

packages/angular_devkit/build_angular/BUILD.bazel

-4
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,6 @@ ts_library(
299299
LARGE_SPECS = {
300300
"application": {
301301
"shards": 10,
302-
"tags": [
303-
# TODO: This is broken as app-shell tests do not work in Node versions prior to 18.13 due to Zone.js and SafePromise.
304-
"node16-broken",
305-
],
306302
"extra_deps": [
307303
"@npm//buffer",
308304
],

tools/toolchain_info.bzl

-6
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,11 @@
33
# the name can be anything the user wants this is just added to the target to create unique names
44
# the order will match against the order in the TOOLCHAIN_VERSION list.
55
TOOLCHAINS_NAMES = [
6-
"node16",
76
"node18",
87
]
98

109
# this is the list of toolchains that should be used and are registered with nodejs_register_toolchains in the WORKSPACE file
1110
TOOLCHAINS_VERSIONS = [
12-
select({
13-
"@bazel_tools//src/conditions:linux_x86_64": "@node16_linux_amd64//:node_toolchain",
14-
"@bazel_tools//src/conditions:darwin": "@node16_darwin_amd64//:node_toolchain",
15-
"@bazel_tools//src/conditions:windows": "@node16_windows_amd64//:node_toolchain",
16-
}),
1711
select({
1812
"@bazel_tools//src/conditions:linux_x86_64": "@node18_linux_amd64//:node_toolchain",
1913
"@bazel_tools//src/conditions:darwin": "@node18_darwin_amd64//:node_toolchain",

yarn.lock

+4-7
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131

132132
"@angular/build-tooling@https://github.com/angular/dev-infra-private-build-tooling-builds.git#22a9a75114d5e80907054f01b9fa360972de1c05":
133133
version "0.0.0-9931e1a8d1b62fcd2267e89f9993a494856cc1cd"
134-
uid "22a9a75114d5e80907054f01b9fa360972de1c05"
135134
resolved "https://github.com/angular/dev-infra-private-build-tooling-builds.git#22a9a75114d5e80907054f01b9fa360972de1c05"
136135
dependencies:
137136
"@angular-devkit/build-angular" "16.2.0-next.4"
@@ -292,7 +291,6 @@
292291

293292
"@angular/ng-dev@https://github.com/angular/dev-infra-private-ng-dev-builds.git#2c4d983ef0f1f000a8554b3b7fbf7f1061c877d3":
294293
version "0.0.0-9931e1a8d1b62fcd2267e89f9993a494856cc1cd"
295-
uid "2c4d983ef0f1f000a8554b3b7fbf7f1061c877d3"
296294
resolved "https://github.com/angular/dev-infra-private-ng-dev-builds.git#2c4d983ef0f1f000a8554b3b7fbf7f1061c877d3"
297295
dependencies:
298296
"@yarnpkg/lockfile" "^1.1.0"
@@ -3475,10 +3473,10 @@
34753473
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b"
34763474
integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==
34773475

3478-
"@types/node@^16.11.7":
3479-
version "16.18.39"
3480-
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.39.tgz#aa39a1a87a40ef6098ee69689a1acb0c1b034832"
3481-
integrity sha512-8q9ZexmdYYyc5/cfujaXb4YOucpQxAV4RMG0himLyDUOEr8Mr79VrqsFI+cQ2M2h89YIuy95lbxuYjxT4Hk4kQ==
3476+
"@types/node@^18.13.0":
3477+
version "18.17.5"
3478+
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.17.5.tgz#c58b12bca8c2a437b38c15270615627e96dd0bc5"
3479+
integrity sha512-xNbS75FxH6P4UXTPUJp/zNPq6/xsfdJKussCWNOnz4aULWIRwMgP1LgaB5RiBnMX1DPCYenuqGZfnIAx5mbFLA==
34823480

34833481
"@types/npm-package-arg@*", "@types/npm-package-arg@^6.1.0":
34843482
version "6.1.1"
@@ -10827,7 +10825,6 @@ sass@^1.55.0:
1082710825

1082810826
"sauce-connect-proxy@https://saucelabs.com/downloads/sc-4.9.1-linux.tar.gz":
1082910827
version "0.0.0"
10830-
uid "9310bc860f7870a1f872b11c4dc6073a1ad34e5e"
1083110828
resolved "https://saucelabs.com/downloads/sc-4.9.1-linux.tar.gz#9310bc860f7870a1f872b11c4dc6073a1ad34e5e"
1083210829

1083310830
saucelabs@^1.5.0:

0 commit comments

Comments
 (0)