Skip to content

Commit 5260164

Browse files
authored
feat!: drop support for Node.js 18 and 20 (#3074)
BREAKING CHANGE: The minimum supported Node.js version is now 22.0.0. Node.js 18 reached end-of-life in April 2025 and Node.js 20 in April 2026. - Bump engines to >=22.0.0 across all packages - CI matrix now tests on Node 22 and 24 - Pin CI to Node 24 instead of latest due to Playwright/yauzl bug with Node 26 (microsoft/playwright#40724) - Disable native type stripping in CI for ts-node compatibility - Bump GitHub Actions to latest versions (checkout v6, setup-node v6, upload-artifact v7) Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e8042eb commit 5260164

42 files changed

Lines changed: 105 additions & 59 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/drop-eol-node.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
'@web/browser-logs': major
3+
'@web/config-loader': major
4+
'@web/dev-server-core': major
5+
'@web/dev-server-esbuild': major
6+
'@web/dev-server-hmr': major
7+
'@web/dev-server-import-maps': major
8+
'@web/dev-server-legacy': major
9+
'@web/dev-server': major
10+
'@web/dev-server-polyfill': major
11+
'@web/dev-server-rollup': major
12+
'@web/mocks': major
13+
'@web/parse5-utils': major
14+
'@web/polyfills-loader': major
15+
'@web/rollup-plugin-copy': major
16+
'@web/rollup-plugin-html': major
17+
'@web/rollup-plugin-import-meta-assets': major
18+
'@web/rollup-plugin-polyfills-loader': major
19+
'rollup-plugin-workbox': major
20+
'@web/storybook-addon-mocks': major
21+
'@web/storybook-builder': major
22+
'@web/storybook-framework-web-components': major
23+
'@web/storybook-utils': major
24+
'@web/test-runner-browserstack': major
25+
'@web/test-runner-chrome': major
26+
'@web/test-runner-cli': major
27+
'@web/test-runner-commands': major
28+
'@web/test-runner-core': major
29+
'@web/test-runner-coverage-v8': major
30+
'@web/test-runner-junit-reporter': major
31+
'@web/test-runner-mocha': major
32+
'@web/test-runner-module-mocking': major
33+
'@web/test-runner': major
34+
'@web/test-runner-playwright': major
35+
'@web/test-runner-puppeteer': major
36+
'@web/test-runner-saucelabs': major
37+
'@web/test-runner-selenium': major
38+
'@web/test-runner-visual-regression': major
39+
'@web/test-runner-webdriver': major
40+
---
41+
42+
Drop support for Node.js 18 and 20, which have reached end-of-life. The minimum supported Node.js version is now 22.0.0.

.github/workflows/canary.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ jobs:
1818
id-token: write
1919
steps:
2020
- name: Checkout Repo
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v6
2222
with:
2323
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2424
fetch-depth: 0
2525

2626
- name: Setup Node.js
27-
uses: actions/setup-node@v4
27+
uses: actions/setup-node@v6
2828
env:
2929
FORCE_COLOR: 0
3030
with:

.github/workflows/lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ jobs:
1212
runs-on: ubuntu-24.04
1313

1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v6
1616

17-
- name: Setup Node 20
18-
uses: actions/setup-node@v4
17+
- name: Setup Node 22
18+
uses: actions/setup-node@v6
1919
env:
2020
FORCE_COLOR: 0
2121
with:
22-
node-version: 20
22+
node-version: 22
2323
cache: npm
2424

2525
- name: Install Dependencies

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ jobs:
1818
pull-requests: write
1919
steps:
2020
- name: Checkout Repo
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v6
2222
with:
2323
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2424
fetch-depth: 0
2525

2626
- name: Setup Node.js
27-
uses: actions/setup-node@v4
27+
uses: actions/setup-node@v6
2828
env:
2929
FORCE_COLOR: 0
3030
with:

.github/workflows/verify-browser.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ jobs:
1212
runs-on: ubuntu-24.04
1313

1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v6
1616

1717
# TODO: remove when GitHub fixes this https://github.com/actions/runner-images/issues/10015
1818
# (this workaround is practically the same what Playwright did in https://github.com/microsoft/playwright/pull/34238/files)
1919
- name: Workaround for Chrome sandbox issue in Ubuntu 24.04
2020
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
2121

22-
- name: Setup Node 20
23-
uses: actions/setup-node@v4
22+
- name: Setup Node 22
23+
uses: actions/setup-node@v6
2424
env:
2525
FORCE_COLOR: 0
2626
with:
27-
node-version: 20
27+
node-version: 22
2828
cache: npm
2929

3030
- name: Install Dependencies

.github/workflows/verify-node.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
node-version:
17-
- '18'
18-
- '20'
1917
- '22'
18+
# TODO: add 'latest' once Playwright fixes yauzl for Node 26
19+
# https://github.com/microsoft/playwright/issues/40724
2020
- '24'
2121

2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@v6
2424

2525
# TODO: remove when GitHub fixes this https://github.com/actions/runner-images/issues/10015
2626
# (this workaround is practically the same what Playwright did in https://github.com/microsoft/playwright/pull/34238/files)
2727
- name: Workaround for Chrome sandbox issue in Ubuntu 24.04
2828
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
2929

3030
- name: Setup Node ${{ matrix.node-version }}
31-
uses: actions/setup-node@v4
31+
uses: actions/setup-node@v6
3232
env:
3333
FORCE_COLOR: 0
3434
with:
@@ -57,7 +57,8 @@ jobs:
5757
- name: Test
5858
run: npm run test:node
5959
env:
60-
NODE_OPTIONS: ${{ (matrix.node-version != '18' && matrix.node-version != '20') && '--no-experimental-strip-types' || '' }}
60+
# Node 22.18+ native type stripping preempts ts-node. Remove when mocha is replaced with node:test.
61+
NODE_OPTIONS: '--no-experimental-strip-types'
6162

6263
verify-windows:
6364
timeout-minutes: 30
@@ -69,14 +70,14 @@ jobs:
6970
git config --global core.autocrlf false
7071
git config --global core.eol lf
7172
72-
- uses: actions/checkout@v4
73+
- uses: actions/checkout@v6
7374

74-
- name: Setup Node '20'
75-
uses: actions/setup-node@v4
75+
- name: Setup Node '22'
76+
uses: actions/setup-node@v6
7677
env:
7778
FORCE_COLOR: 0
7879
with:
79-
node-version: '20'
80+
node-version: '22'
8081
cache: 'npm'
8182

8283
# Set up GitHub Actions caching for Wireit.
@@ -97,3 +98,6 @@ jobs:
9798

9899
- name: Test
99100
run: npm run test:node
101+
env:
102+
# Node 22.18+ native type stripping preempts ts-node. Remove when mocha is replaced with node:test.
103+
NODE_OPTIONS: '--no-experimental-strip-types'

.github/workflows/verify-storybook-builder.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
env:
1515
PUPPETEER_SKIP_DOWNLOAD: true # prevent failures due to puppeteer downloading issues, since it's not used here anyway
1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v6
1818

1919
- name: Setup Node 22
20-
uses: actions/setup-node@v4
20+
uses: actions/setup-node@v6
2121
env:
2222
FORCE_COLOR: 0
2323
with:
@@ -39,7 +39,7 @@ jobs:
3939
- name: Run tests
4040
run: npm run test:storybook-builder
4141

42-
- uses: actions/upload-artifact@v4
42+
- uses: actions/upload-artifact@v7
4343
if: always()
4444
with:
4545
name: playwright-report-${{ matrix.runs-on }}

packages/browser-logs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}
2323
},
2424
"engines": {
25-
"node": ">=18.0.0"
25+
"node": ">=22.0.0"
2626
},
2727
"scripts": {
2828
"build": "tsc",

packages/config-loader/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"main": "src/index.js",
1717
"type": "commonjs",
1818
"engines": {
19-
"node": ">=18.0.0"
19+
"node": ">=22.0.0"
2020
},
2121
"scripts": {
2222
"build": "tsc",

packages/dev-server-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
}
3232
},
3333
"engines": {
34-
"node": ">=18.0.0"
34+
"node": ">=22.0.0"
3535
},
3636
"scripts": {
3737
"build": "tsc",

0 commit comments

Comments
 (0)