Skip to content

Commit 3a75999

Browse files
authored
Drop support for Node versions less than 16.20.2 (#650)
* Configure development node version to use v22.x * Configure node version in package.json to require latest node 16.x LTS * Update lockfiles after npm install with node v22.x * Update babel and webpack packages, dropping support for Node.js < v16 * Update CI to run with node LTS v16.x and higher Pin to older Ubuntu version in CI to avoid Puppeteer sandbox problem Always run tests to completion with all Node versions, even if one fails * Update tests and skip troublesome ones The expected report sizes match what Node.js v18.x and higher are returning. Node.js v16.x and lower have different gzip calculations. Update expected report size to match reality The troublesome skipped tests are likely those which have regressed in the past but the regression wasn't caused by Node.js support change. Testing Node.js v18.x on CI is skipped for now as tests hang there. * Mention Node.js support drop as a breaking change * Update test badges in README.md * Try running Node.js v18.x in CI * Revert "Try running Node.js v18.x in CI" This reverts commit 377aa2b. The test failure we are seeing in CI with Node.js v18.x is this: FAIL test/viewer.js (5.081 s) ● WebSocket server › should not crash when an error is emitted on the websocket connect ECONNREFUSED ::1:41847 ● WebSocket server › should not crash when an error is emitted on the websocket thrown: "Exceeded timeout of 5000 ms for a test while waiting for `done()` to be called. Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout." 9 | 10 | describe('WebSocket server', function () { > 11 | it('should not crash when an error is emitted on the websocket', function (done) { | ^ 12 | const bundleStats = { 13 | assets: [{name: 'bundle.js', chunks: [0]}] 14 | }; at it (test/viewer.js:11:3) at Object.describe (test/viewer.js:10:1) PASS test/Logger.js PASS test/statsUtils.js PASS test/utils.js PASS test/parseUtils.js PASS test/dev-server.js Test Suites: 1 failed, 7 passed, 8 total Tests: 1 failed, 4 skipped, 115 passed, 120 total Snapshots: 0 total Time: 18.536 s Ran all test suites. Jest did not exit one second after the test run has completed. 'This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
1 parent b82e5fa commit 3a75999

File tree

18 files changed

+14574
-9456
lines changed

18 files changed

+14574
-9456
lines changed

.babelrc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
{
44
"presets": [
55
["@babel/preset-env", {
6-
"targets": {"node": "10.13.0"}
6+
"targets": {"node": "16.20.2"}
77
}]
8-
],
9-
"plugins": [
10-
["@babel/plugin-proposal-class-properties", {"loose": true}],
11-
["@babel/plugin-proposal-private-methods", {"loose": true}]
128
]
139
}

.github/workflows/main.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,35 @@ on:
77
jobs:
88
build-and-test:
99
strategy:
10+
fail-fast: false
1011
matrix:
11-
node: [10.x, 12.x, 14.x, 16.x]
12-
runs-on: ubuntu-latest
13-
name: Tests on Node.js v${{ matrix.node }}
12+
node:
13+
- version: 16.x
14+
# - version: 18.x
15+
# env: NODE_OPTIONS=--openssl-legacy-provider
16+
- version: 20.x
17+
env: NODE_OPTIONS=--openssl-legacy-provider
18+
- version: 22.x
19+
env: NODE_OPTIONS=--openssl-legacy-provider
20+
runs-on: ubuntu-22.04
21+
name: Tests on Node.js v${{ matrix.node.version }}
1422
steps:
1523
- name: Checkout repo
1624
uses: actions/checkout@v3
1725

1826
- name: Setup node
1927
uses: actions/setup-node@v3
2028
with:
21-
node-version: ${{ matrix.node }}
29+
node-version: ${{ matrix.node.version }}
2230

2331
- name: Download deps
2432
uses: bahmutov/npm-install@v1
2533

2634
- name: Build sources
27-
run: npm run build
35+
run: ${{ matrix.node.env }} npm run build
2836

2937
- name: Run tests
30-
run: npm run test
38+
run: ${{ matrix.node.env }} npm run test
3139

3240
lint:
3341
runs-on: ubuntu-latest
@@ -38,7 +46,7 @@ jobs:
3846
- name: Setup node
3947
uses: actions/setup-node@v3
4048
with:
41-
node-version: "14.x"
49+
node-version: "22.x"
4250

4351
- name: Download deps
4452
uses: bahmutov/npm-install@v1

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22.14.0

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
1212

1313
## UNRELEASED
1414

15+
* **Breaking Change**
16+
* Remove explicit support for Node versions below 16.20.2 ([#650](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/650) by [@valscion](https://github.com/valscion))
17+
* **NOTE:** `webpack-bundle-analyzer` might still support older Node versions but they are no longer tested against.
18+
1519
* **Improvement**
1620
* Parse bundles as ES modules based on stats JSON information ([#649](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/649) by [@eamodio](https://github.com/eamodio))
1721

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ To get more information about it you can read [issue #147](https://github.com/we
210210
[node]: https://img.shields.io/node/v/webpack-bundle-analyzer.svg
211211
[node-url]: https://nodejs.org
212212

213-
[tests]: http://img.shields.io/travis/webpack-contrib/webpack-bundle-analyzer.svg
214-
[tests-url]: https://travis-ci.org/webpack-contrib/webpack-bundle-analyzer
213+
[tests]: https://github.com/webpack-contrib/webpack-bundle-analyzer/actions/workflows/main.yml/badge.svg
214+
[tests-url]: https://github.com/webpack-contrib/webpack-bundle-analyzer/actions/workflows/main.yml
215215

216216
[downloads]: https://img.shields.io/npm/dt/webpack-bundle-analyzer.svg
217217
[downloads-url]: https://npmjs.com/package/webpack-bundle-analyzer

0 commit comments

Comments
 (0)