chore: update webpack-dev-server to v6 and test against v5 and v6 - #4834
chore: update webpack-dev-server to v6 and test against v5 and v6#4834bjohansebas wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 946aeb0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
This PR is packaged and the instant preview is available (946aeb0). Install it locally:
npm i -D webpack-cli@https://pkg.pr.new/webpack-cli@946aeb0
yarn add -D webpack-cli@https://pkg.pr.new/webpack-cli@946aeb0
pnpm add -D webpack-cli@https://pkg.pr.new/webpack-cli@946aeb0 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4834 +/- ##
==========================================
+ Coverage 93.32% 93.34% +0.02%
==========================================
Files 14 14
Lines 5466 5472 +6
Branches 793 793
==========================================
+ Hits 5101 5108 +7
+ Misses 363 362 -1
Partials 2 2
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Bump the dev dependency to `webpack-dev-server@6` and add snapshots for it, which the snapshot resolver already supports through the `.snap.devServer<major>.webpack<major>` extension. CI now runs the test matrix against both v5 and v6, installing v5 with npm for that job. `webpack-dev-server` v6 is ESM and exposes the server as its `default` export, while v5 exports it directly, so the CLI now resolves the constructor type from the default export when there is one. Runtime behavior is unchanged, the package was already loaded through `(await import(pkg)).default`.
6cf3728 to
946aeb0
Compare
Summary
Updates the
webpack-dev-serverdev dependency to v6 and makes the test suite cover both v5 and v6, which are the versions thewebpack-clipeer range allows (^5.0.0 || ^6.0.0)..snap.devServer<major>.webpack<major>extension, so no tooling change was needed. The only difference in the output is the help text for--server-type, since v6 dropsspdyfrom the possible values.dev-server-version: [5, latest], installing v5 withnpm install ... --no-save --ignore-scriptsfor that job, following the same approach as chore: use plugin support #4791.webpack-dev-serverv6 is ESM and exposes the server as itsdefaultexport, while v5 exports it directly, sotscfailed with "This expression is not constructable". The CLI now resolves the constructor type from the default export when there is one, which type-checks against both versions. Runtime behavior is unchanged: the package was already loaded through(await import(pkg)).default.What kind of change does this PR introduce?
chore, plus a types fix in
webpack-cli.Did you add tests for your changes?
No new tests, the existing
test/helpandtest/servesuites now run against both dev-server versions with their own snapshots.Does this PR introduce a breaking change?
No. The peer range already allowed v6, and the type change only affects how the constructor type is resolved.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
SERVE-OPTIONS-v6.mdwill be generated by the scheduled "Update documentation" workflow, which derives the filename from the installed dev-server major.Use of AI
Yes. I used Claude Code (Opus) to carry out the upgrade under my direction: the dependency bump, the type fix, the CI matrix and the snapshots. I verified the build and ran
test/helpagainst the new snapshots locally, and reviewed the final diff.