Skip to content

Drop support for Node.js <22, update webpack related dependencies#1395

Merged
Kocal merged 11 commits into
symfony:mainfrom
Kocal:webpack-encore-1393
Mar 11, 2026
Merged

Drop support for Node.js <22, update webpack related dependencies#1395
Kocal merged 11 commits into
symfony:mainfrom
Kocal:webpack-encore-1393

Conversation

@Kocal

@Kocal Kocal commented Mar 10, 2026

Copy link
Copy Markdown
Member
Q A
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #1393, fix #1392
License MIT

@Kocal Kocal self-assigned this Mar 10, 2026
@carsonbot carsonbot added Feature New Feature Status: Needs Review Needs to be reviewed labels Mar 10, 2026
@Kocal Kocal force-pushed the webpack-encore-1393 branch 2 times, most recently from 3692786 to 06f055f Compare March 11, 2026 07:17
@Kocal Kocal requested a review from Copilot March 11, 2026 07:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-parser with minimist and 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.

Comment thread .github/workflows/high-depends.yml Outdated
Comment thread lib/config/parse-runtime.js
Comment thread CHANGELOG.md Outdated
Comment thread .github/workflows/stable-tests.yml Outdated
Comment thread .github/workflows/low-depends.yml Outdated
@Kocal Kocal force-pushed the webpack-encore-1393 branch from 24a63c5 to 46fc9a6 Compare March 11, 2026 07:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread test_apps/yarn-pnp/package.json Outdated
@@ -8,7 +8,7 @@
"@babel/core": "^7.17.0",
"@babel/preset-env": "^7.16.0",
"webpack": "^5.74.0",

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
"webpack": "^5.74.0",
"webpack": "^5.82.0",

Copilot uses AI. Check for mistakes.
@@ -9,7 +9,7 @@
"@babel/plugin-proposal-partial-application": "^7.18.9",
"@babel/preset-env": "^7.16.0",
"webpack": "^5.74.0",

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
"webpack": "^5.74.0",
"webpack": "^5.82.0",

Copilot uses AI. Check for mistakes.
Comment thread test_apps/npm/package.json Outdated
@@ -8,6 +8,6 @@
"@babel/core": "^7.17.0",
"@babel/preset-env": "^7.16.0",
"webpack": "^5.74.0",

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
"webpack": "^5.74.0",
"webpack": "^5.82.0",

Copilot uses AI. Check for mistakes.
Comment thread test_apps/npm-with-external-babel-config/package.json Outdated
Comment thread test_apps/npm-with-babel/package.json Outdated
Comment thread package.json
Comment thread CHANGELOG.md Outdated

## 6.0.0

* Drop support for Node.js <22, minimum is now Node.js 22.13.0

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
* 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

Copilot uses AI. Check for mistakes.
Comment thread package.json
@Kocal Kocal force-pushed the webpack-encore-1393 branch from e3e0673 to 65a9aef Compare March 11, 2026 08:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 14 to +19
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)

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread package.json
Comment on lines 24 to +25
"engines": {
"node": "^18.12.0 || ^20.0.0 || >=22.0"
"node": "^22.13.0 || >=24.0"

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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).

Copilot uses AI. Check for mistakes.
Comment thread test_apps/install-deps.sh
Comment on lines +5 to +15
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

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
- name: Checkout
uses: actions/checkout@v4

- name: Node ${{matrix.node-versions}}

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- name: Node ${{matrix.node-versions}}
- name: Node 22.13.0

Copilot uses AI. Check for mistakes.
- name: Checkout
uses: actions/checkout@v4

- name: Node ${{matrix.node-versions}}

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- name: Node ${{matrix.node-versions}}
- name: Node 22.13.0

Copilot uses AI. Check for mistakes.
@Kocal Kocal merged commit f9bedcf into symfony:main Mar 11, 2026
22 of 28 checks passed
@Kocal Kocal deleted the webpack-encore-1393 branch March 11, 2026 08:14
@Kocal Kocal added this to the 6.0 milestone Mar 11, 2026
@Kocal Kocal removed the request for review from Copilot March 23, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New Feature Status: Needs Review Needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade minimal support of Node.js to 22.13.0 Update version of css-minimizer-webpack-plugin to 8.0.0

3 participants