build: update dependency webpack-dev-middleware to v8 (main)#32816
build: update dependency webpack-dev-middleware to v8 (main)#32816angular-robot wants to merge 1 commit intoangular:mainfrom
Conversation
See associated pull request for more information.
There was a problem hiding this comment.
Code Review
This pull request updates webpack-dev-middleware to version 8.0.0, which is a major update containing breaking changes. A significant breaking change makes this update incompatible with webpack-dev-server@5.2.3, which is a dependency in this project. This creates a risky situation and should be addressed. I have left a comment detailing the issue.
| "tslib": "2.8.1", | ||
| "webpack": "5.105.4", | ||
| "webpack-dev-middleware": "7.4.5", | ||
| "webpack-dev-middleware": "8.0.0", |
There was a problem hiding this comment.
This update to webpack-dev-middleware v8.0.0 creates a serious mismatch between compile-time types and runtime behavior.
@angular-devkit/build_angular has a direct dependency on webpack-dev-middleware, which appears to be for resolving TypeScript types. With this change, it will resolve to v8.0.0.
However, webpack-dev-server@5.2.3, which is used at runtime, depends on webpack-dev-middleware@^7.0.0. pnpm will correctly provide webpack-dev-server with a v7 release of the middleware, avoiding an immediate runtime crash. This creates a dangerous situation where the code is compiled against v8 types, but runs against a v7 implementation. While this might not break immediately if the used options are compatible, it is a fragile setup.
A key breaking change in webpack-dev-middleware@8.0.0 is that getFilenameFromUrl is now async. webpack-dev-server@5.2.3 uses it synchronously. If for any reason webpack-dev-server resolves to v8 at runtime, it will break.
To avoid this fragility and potential for runtime errors, this dependency should be kept in sync with what webpack-dev-server supports. This update should be reverted until webpack-dev-server officially supports webpack-dev-middleware v8.
| "webpack-dev-middleware": "8.0.0", | |
| "webpack-dev-middleware": "7.4.5", |
This PR contains the following updates:
7.4.5→8.0.0Release Notes
webpack/webpack-dev-middleware (webpack-dev-middleware)
v8.0.0Compare Source
Major Changes
The
getFilenameFromUrlfunction is now asynchronous, returning a Promise that resolves to the object with the foundfilename(orundefinedif the file was not found) or throws an error if the URL cannot be processed. Additionally, the object contains theextraproperty withstats(file system stats) andoutputFileSystem(output file system where file was found) properties. (by @alexander-akait in #2284)Minimum supported
Node.jsversion is20.9.0. (by @alexander-akait in #2284)Minimum supported
webpackversion is5.101.0. (by @alexander-akait in #2284)Minor Changes
Added support for plugin usage, useful when the middleware will be used as a webpack plugin (no stats output, no extra actions). (by @alexander-akait in #2284)
Added the
forwardErroroption to enable error forwarding to next middleware. (by @alexander-akait in #2284)Enable
cacheImmutableby default for immutable assets. (by @alexander-akait in #2284)Patch Changes
Improved initial loading module time. (by @alexander-akait in #2284)
Removed outdated code and improved performance by avoiding extra loops. (by @alexander-akait in #2284)
All notable changes to this project will be documented in this file. See standard-version for commit guidelines.
7.4.5 (2025-09-24)
Bug Fixes
7.4.4 (2025-09-23)
Bug Fixes
7.4.3 (2025-09-05)
Bug Fixes
7.4.2 (2024-08-21)
Bug Fixes
7.4.1 (2024-08-20)
Bug Fixes
assetsInfomay be undefined (rspack) (#1927) (21f1797)