Repository navigation
build: update dependency webpack-dev-middleware to v8.5.0 (22.2.x) - #34549
Merged
alan-agius4 merged 1 commit intoOct 28, 2026
Merged
alan-agius4 merged 1 commit into
alan-agius4 merged 1 commit into
Conversation
See associated pull request for more information.
alan-agius4
approved these changes
Oct 28, 2026
Collaborator
|
This PR was merged into the repository. The changes were merged into the following branches:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
8.3.0→8.5.0Release Notes
webpack/webpack-dev-middleware (webpack-dev-middleware)
v8.5.0Compare Source
Minor Changes
hot.tokenalso takes{ value, required }. Withrequired: falsea token is minted (orvalueused) and handed to the injected client as usual, but the endpoint does not refuse a client without it, so a server with policy of its own can compare it inonConnectalongside, say, the origins it already allows. The instance's newhot.tokenRequiredsays which applies. (by @alexander-akait in #2486)v8.4.0Compare Source
Minor Changes
The client posts build events to the page the way webpack-dev-server's does (
webpackOk,webpackErrors,webpackCloseand the rest), logsDisconnected!when the connection drops and clears the build's problems from the overlay until it is back.progressaccepts"circular"or"linear". Reloads skip a page that is already navigating away, use the nearest ancestor with a url of its own inside anabout:blankiframe, and inapply: "reload"follow a sibling compilation's build too. (by @alexander-akait in #2425)HotModuleReplacementPluginnow goes to every compilation the middleware serves, including server bundles that hot-reload throughwebpack/hot/poll.hot.client.transportalso accepts a module exporting a client class of your own, and the newhot.wsoption is passed to thewsserver (compression,verifyClient, or aportorserverof its own), withhot.corsandhot.tokenstill checked. The connection the runtime holds is exported aswebpack-dev-middleware/client/socketfor tooling that listens alongside it. (by @alexander-akait in #2472)Grouped
etag,lastModified,cacheControlandcacheImmutableintocache.*, andmimeTypesandmimeTypeDefaultintomime.*; the old names warn and keep working until the next major release, and the grouped name wins when both are set. Media types now resolve throughmime-dbdirectly, andmime.typesbelongs to its own middleware instead of being written into the tablemime-typesshares with the whole process.instance.context.optionsis a copy of the options passed,cache.controlincluded. (by @alexander-akait in #2455)hot.client.apply("hmr","hmr-only","reload"or"nothing") says what a build does to the page, so a project without HMR still reloads on a change; a single page can choose its own mode with?webpack-dev-middleware-apply=, and publishing{ action: "reload" }reloads every page.hot.client.connect(false, or{ retries, timeout }) controls connecting and reconnecting, withretrieshonoured on both transports. Thehot,liveReload,reload,autoConnect,reconnectandtimeoutquery parameters they replace are still read until the next major release, with a deprecation warning for this package's own three. (by @alexander-akait in #2458)Added
hot.client, which sets the browser runtime's options on the middleware under the same names the entry query takes, so a configuration no longer needs a hand-written query string.urlaccepts a url or its parts ({ port: 8080 }) and resolves the rest in the page,pageParamPrefixrenames the per-page?webpack-dev-middleware-apply=parameter, andloggingaccepts{ level, name }so an embedding package can label the console with its own name. (by @alexander-akait in #2436)Added
hot.corsto choose which origins may reach the hot endpoint: Server-Sent Events still allow every origin until the next major release, while the new WebSocket transport allows only local origins and refuses others with403before the handshake. Addedhot.token, a secret the injected client carries and the endpoint requires, for the case where a browser sends noOrigin; it is off by default. (by @alexander-akait in #2444)hotnow adds the client andHotModuleReplacementPluginto the compilation itself, so enabling it is all a webpack configuration needs.hot.injectsays what is added:"all"(the default),"plugin"for a page with a client of its own,"client"for a configuration that applies the plugin itself, or"none". Web workers get a client too, nothing is injected into a non-browser target, and the HMR plugin is left out whenhot.client.applyisreloadornothing. (by @alexander-akait in #2430)The instance gains
attach(server),handleUpgrade(req, socket, head),onConnect(fn)(now given the request as well as the client),publish(payload)andpublishTo(client, payload), so a server can own the upgrade, decide who may listen and put payloads of its own on the stream, such asProgressPluginticks. The client understands{ action: "error", message }, logging the reason a server refused it and posting it to the page aswebpackError. (by @alexander-akait in #2431)hot.transportchooses how events reach the browser: Server-Sent Events (the default),"ws"for a WebSocket, or a transport of your own, which only needsonConnect,publish,publishToandclose. The client speaks both built-in wires, also exported aswebpack-dev-middleware/client/sseandwebpack-dev-middleware/client/ws, and behaves the same on either. (by @alexander-akait in #2420)overlay.idnames the overlay element, so a package embedding it can keep the id its users already query. The newwebpack-dev-middleware/client/problemexport formats one of webpack's errors or warnings withformatProblem, andshowProblemsaccepts webpack's objects as well as strings. (by @alexander-akait in #2438)Patch Changes
Bound the internal url and
Rangeheader caches, which grew for the life of the process and were never released, even byclose(). (by @alexander-akait in #2405)The client exports ship type declarations and are marked as the ES modules they are. The client logs through webpack's
Loggerwithoutwebpack/lib/logging/runtime.js, souniversaland["web", "node"]bundles no longer pull in a node builtin and a page enforcing Trusted Types needs no guard. A module that re-exports the client can hand it its options through__webpack_dev_middleware_client_query__, and?autoConnectis read like every other boolean. (by @alexander-akait in #2428)Deprecated
hot.progress, which keeps working until the next major release: a server that appliesProgressPluginitself ended up with two on one compiler. Remove it, apply the plugin yourself and hand its ticks topublish; the browser-sidehot.client.progressis unaffected. (by @alexander-akait in #2451)The client keeps doing what webpack-dev-server's did: (by @alexander-akait in #2472)
apply: "reload"reloads a reconnected page whose build is out of date.hostname,port,pathname,live-reload,hot=only) still connects, with no deprecation warning for that server's own spelling.z-indexand closes onEsc.The overlay takes focus when it opens and gives it back when it closes, keeps an uncaught runtime error through a successful build, passes a rejected value to
runtimeErrorsfilters aserror.cause, and no longer shows an empty card or leaves the building indicator up after a multi-compiler build. File references in absolute, Windows andfile://stack frames are now clickable. The ANSI-to-HTML conversion is built in, droppingansi-html-communityand fixing its handling of combined, short and unbalanced sequences. (by @alexander-akait in #2437)Validate options with a precompiled schema to cut ~155ms from startup. (by @alexander-akait in #2413)
Hardened the path-traversal guards in
getFilenameFromUrl: the remainder left after thepublicPathprefix is stripped is checked for..on its own, before it is joined onto the output root. A..that leaves the output root and comes back into it, such as/assets../dist/file.js, is now refused rather than served. (by @alexander-akait in #2445)