Drop support for Node.js <22, update webpack related dependencies#1395
Conversation
3692786 to
06f055f
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates Webpack Encore’s supported toolchain by raising the minimum Node.js version and refreshing several webpack-adjacent dependencies (including webpack-cli and css-minimizer), while also migrating CLI argument parsing and updating test fixtures/lockfiles accordingly.
Changes:
- Drop Node.js <22 support (set minimum to Node.js 22.13.0) and update CI matrices to newer Node lines.
- Update webpack-related dependencies (e.g., css-minimizer-webpack-plugin v8, webpack-cli v6) and adjust test apps’ manifests/lockfiles.
- Replace
yargs-parserwithminimistand migrate friendly-errors plugin dependency to@kocal/friendly-errors-webpack-plugin.
Reviewed changes
Copilot reviewed 20 out of 32 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
package.json |
Bumps engine range, swaps/bumps dependencies (friendly-errors fork, minimist, loader/tooling versions). |
yarn.lock |
Updates dependency resolutions for the new dependency set. |
CHANGELOG.md |
Documents the breaking changes and dependency updates. |
bin/encore.js |
Switches CLI argv parsing from yargs-parser to minimist. |
index.js |
Updates docs + switches runtime env parsing helper to minimist. |
lib/config/parse-runtime.js |
Adjusts option key handling for minimist-parsed argv (notably dev-server flags). |
lib/plugins/friendly-errors.js |
Switches plugin import to @kocal/friendly-errors-webpack-plugin. |
lib/plugins/asset-output-display.js |
Updates JSDoc import reference for friendly-errors plugin fork. |
test/config/parse-runtime.js |
Updates tests to build argv via minimist. |
test/plugins/friendly-errors.js |
Updates test import to the new friendly-errors plugin fork. |
fixtures/vuejs3-typescript/types/shims.d.ts |
Adds TS module shim for *.png in the Vue 3 TS fixture. |
.github/workflows/stable-tests.yml |
Updates Node test matrix to newer majors. |
.github/workflows/low-depends.yml |
Updates Node test matrix to newer majors for lowest-deps job. |
.github/workflows/high-depends.yml |
Updates Node test matrix to newer majors for highest-deps job. |
test_apps/yarn-pnp/package.json |
Bumps webpack-cli in Yarn PnP test app. |
test_apps/yarn-pnp/yarn.lock |
Lockfile updates reflecting webpack-cli bump (Yarn PnP). |
test_apps/yarn-pnp-with-external-babel-config/package.json |
Bumps webpack-cli in Yarn PnP + external babel config app. |
test_apps/yarn-pnp-with-external-babel-config/yarn.lock |
Lockfile updates reflecting webpack-cli bump (Yarn PnP + external babel config). |
test_apps/yarn-pnp-with-babel/package.json |
Bumps webpack-cli in Yarn PnP + babel app. |
test_apps/yarn-pnp-with-babel/yarn.lock |
Lockfile updates reflecting webpack-cli bump (Yarn PnP + babel). |
test_apps/pnpm/package.json |
Bumps webpack-cli in pnpm test app. |
test_apps/pnpm/pnpm-lock.yaml |
Lockfile updates reflecting webpack-cli bump (pnpm). |
test_apps/pnpm-with-external-babel-config/package.json |
Bumps webpack-cli in pnpm + external babel config app. |
test_apps/pnpm-with-external-babel-config/pnpm-lock.yaml |
Lockfile updates reflecting webpack-cli bump (pnpm + external babel config). |
test_apps/pnpm-with-babel/package.json |
Bumps webpack-cli in pnpm + babel app. |
test_apps/pnpm-with-babel/pnpm-lock.yaml |
Lockfile updates reflecting webpack-cli bump (pnpm + babel). |
test_apps/npm/package.json |
Bumps webpack-cli in npm test app. |
test_apps/npm/package-lock.json |
Lockfile updates reflecting webpack-cli bump (npm). |
test_apps/npm-with-external-babel-config/package.json |
Bumps webpack-cli in npm + external babel config app. |
test_apps/npm-with-external-babel-config/package-lock.json |
Lockfile updates reflecting webpack-cli bump (npm + external babel config). |
test_apps/npm-with-babel/package.json |
Bumps webpack-cli in npm + babel app. |
test_apps/npm-with-babel/package-lock.json |
Lockfile updates reflecting webpack-cli bump (npm + babel). |
Files not reviewed (6)
- test_apps/npm-with-babel/package-lock.json: Language not supported
- test_apps/npm-with-external-babel-config/package-lock.json: Language not supported
- test_apps/npm/package-lock.json: Language not supported
- test_apps/pnpm-with-babel/pnpm-lock.yaml: Language not supported
- test_apps/pnpm-with-external-babel-config/pnpm-lock.yaml: Language not supported
- test_apps/pnpm/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7678a5b to
24a63c5
Compare
…/friendly-errors-webpack-plugin
24a63c5 to
46fc9a6
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 31 changed files in this pull request and generated 8 comments.
Files not reviewed (6)
- test_apps/npm-with-babel/package-lock.json: Language not supported
- test_apps/npm-with-external-babel-config/package-lock.json: Language not supported
- test_apps/npm/package-lock.json: Language not supported
- test_apps/pnpm-with-babel/pnpm-lock.yaml: Language not supported
- test_apps/pnpm-with-external-babel-config/pnpm-lock.yaml: Language not supported
- test_apps/pnpm/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -8,7 +8,7 @@ | |||
| "@babel/core": "^7.17.0", | |||
| "@babel/preset-env": "^7.16.0", | |||
| "webpack": "^5.74.0", | |||
There was a problem hiding this comment.
These test apps now use webpack-cli@^6.0.1, which has a peer dependency on webpack@^5.82.0. This package.json still pins webpack to ^5.74.0, which will produce peer-dependency conflicts (and may fail installs under stricter configurations). Consider bumping webpack here to at least ^5.82.0 (or matching the repo’s chosen baseline).
| "webpack": "^5.74.0", | |
| "webpack": "^5.82.0", |
| @@ -9,7 +9,7 @@ | |||
| "@babel/plugin-proposal-partial-application": "^7.18.9", | |||
| "@babel/preset-env": "^7.16.0", | |||
| "webpack": "^5.74.0", | |||
There was a problem hiding this comment.
These test apps now use webpack-cli@^6.0.1, which has a peer dependency on webpack@^5.82.0. This package.json still pins webpack to ^5.74.0, which will produce peer-dependency conflicts (and may fail installs under stricter configurations). Consider bumping webpack here to at least ^5.82.0 (or matching the repo’s chosen baseline).
| "webpack": "^5.74.0", | |
| "webpack": "^5.82.0", |
| @@ -8,6 +8,6 @@ | |||
| "@babel/core": "^7.17.0", | |||
| "@babel/preset-env": "^7.16.0", | |||
| "webpack": "^5.74.0", | |||
There was a problem hiding this comment.
These test apps now use webpack-cli@^6.0.1, which has a peer dependency on webpack@^5.82.0. This package.json still pins webpack to ^5.74.0, which will produce peer-dependency conflicts (and may fail installs under stricter configurations). Consider bumping webpack here to at least ^5.82.0 (or matching the repo’s chosen baseline).
| "webpack": "^5.74.0", | |
| "webpack": "^5.82.0", |
|
|
||
| ## 6.0.0 | ||
|
|
||
| * Drop support for Node.js <22, minimum is now Node.js 22.13.0 |
There was a problem hiding this comment.
The entry says “Drop support for Node.js <22, minimum is now Node.js 22.13.0”. If the minimum is specifically 22.13.0, the first part should match that (e.g., “Drop support for Node.js <22.13.0”) to avoid implying earlier 22.x releases are still supported.
| * Drop support for Node.js <22, minimum is now Node.js 22.13.0 | |
| * Drop support for Node.js <22.13.0, minimum is now Node.js 22.13.0 |
46fc9a6 to
e3e0673
Compare
…ing type declarations." in tests
e3e0673 to
65a9aef
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 32 changed files in this pull request and generated 5 comments.
Files not reviewed (6)
- test_apps/npm-with-babel/package-lock.json: Language not supported
- test_apps/npm-with-external-babel-config/package-lock.json: Language not supported
- test_apps/npm/package-lock.json: Language not supported
- test_apps/pnpm-with-babel/pnpm-lock.yaml: Language not supported
- test_apps/pnpm-with-external-babel-config/pnpm-lock.yaml: Language not supported
- test_apps/pnpm/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| webpack: | ||
| specifier: ^5.94.0 | ||
| version: 5.94.0(webpack-cli@5.1.4) | ||
| specifier: ^5.82.0 | ||
| version: 5.94.0(webpack-cli@6.0.1) | ||
| webpack-cli: | ||
| specifier: ^5.1.4 | ||
| version: 5.1.4(webpack@5.94.0) | ||
| specifier: ^6.0.1 | ||
| version: 6.0.1(webpack@5.94.0) |
There was a problem hiding this comment.
In this pnpm lockfile, the devDependencies.webpack.specifier is still ^5.94.0 even though test_apps/pnpm/package.json now declares webpack: ^5.82.0. With --frozen-lockfile/CI installs, pnpm can fail when the lock specifier doesn't match package.json. Regenerate the lockfile (or manually update the specifier) so it matches the updated package.json range.
| "engines": { | ||
| "node": "^18.12.0 || ^20.0.0 || >=22.0" | ||
| "node": "^22.13.0 || >=24.0" |
There was a problem hiding this comment.
"node": "^22.13.0 || >=24.0" excludes Node.js 23.x entirely. If the intent is only to drop support for <22.13.0 (per PR title/issue), consider using a range like >=22.13.0 (or explicitly documenting/test-matrixing the decision to drop 23.x).
| for dir in $(find . -type d -name "npm*"); do | ||
| echo "Installing dependencies for $dir" | ||
| (cd "$dir" && npm install) | ||
| done | ||
|
|
||
| for dir in $(find . -type d -name "yarn*"); do | ||
| echo "Installing dependencies for $dir" | ||
| (cd "$dir" && yarn) | ||
| done | ||
|
|
||
| for dir in $(find . -type d -name "pnpm*"); do |
There was a problem hiding this comment.
The for dir in $(find ...) loops will break on directory names containing whitespace/newlines due to word-splitting. Consider switching to a null-delimited find ... -print0 with a while IFS= read -r -d '' dir; do ...; done loop (and optionally set -euo pipefail) to make this script robust.
| for dir in $(find . -type d -name "npm*"); do | |
| echo "Installing dependencies for $dir" | |
| (cd "$dir" && npm install) | |
| done | |
| for dir in $(find . -type d -name "yarn*"); do | |
| echo "Installing dependencies for $dir" | |
| (cd "$dir" && yarn) | |
| done | |
| for dir in $(find . -type d -name "pnpm*"); do | |
| find . -type d -name "npm-*" -print0 | while IFS= read -r -d '' dir; do | |
| echo "Installing dependencies for $dir" | |
| (cd "$dir" && npm install) | |
| done | |
| find . -type d -name "yarn-*" -print0 | while IFS= read -r -d '' dir; do | |
| echo "Installing dependencies for $dir" | |
| (cd "$dir" && yarn) | |
| done | |
| find . -type d -name "pnpm-*" -print0 | while IFS= read -r -d '' dir; do |
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Node ${{matrix.node-versions}} |
There was a problem hiding this comment.
This step name references matrix.node-versions, but this workflow's matrix only defines matrix.app (no node-versions). Either change the step name to a static value (e.g. Node 22.13.0) or introduce a node-versions matrix entry if multiple versions are intended.
| - name: Node ${{matrix.node-versions}} | |
| - name: Node 22.13.0 |
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Node ${{matrix.node-versions}} |
There was a problem hiding this comment.
This step name references matrix.node-versions, but this job doesn't define a matrix (it runs a single Node version). Rename the step to a static label (e.g. Node 22.13.0) or add a matrix if you intend to run lint across multiple Node versions.
| - name: Node ${{matrix.node-versions}} | |
| - name: Node 22.13.0 |
Uh oh!
There was an error while loading. Please reload this page.