Skip to content

refactor: settle the hot option names before release - #2476

Open
alexander-akait wants to merge 1 commit into
mainfrom
claude/webpack-dev-server-pr-consolidation-t0k72z
Open

alexander-akait wants to merge 1 commit into
mainfrom
claude/webpack-dev-server-pr-consolidation-t0k72z

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

The last pass over the middleware's options before 8.4.0. Everything changed here was added after 8.3.0, so nothing released breaks.

Removed

Option Instead
hot.server attach(server) or handleUpgrade(req, socket, head), which already did the same thing
hot.client.token Filled in from hot.token, the one place a token is set
hot.client.hot, liveReload, reload, autoConnect, reconnect, timeout hot.client.apply and hot.client.connect. The entry query still reads the six old names (with the warning as before) until the next major release, since 8.3.0 entries and webpack-dev-server's hand-written ones use them

Renamed

  • hot.client.path → hot.client.url: it takes a url or its parts, not only a path, and no longer reads like a second hot.path. The query reads both url and path, since path shipped there in 8.3.0.
  • hot.client.urlPrefix → hot.client.pageParamPrefix: it names the page-url parameter (?<prefix>-apply=), not a prefix of any url.

hot.client.transport and cache.immutable keep their names.

Also

  • The hot.transport description no longer mentions server.
  • Schema check, types, README, validation snapshots and the two affected changesets are updated; no new changeset, since the options never shipped under the old names.
  • The test that keeps hot.client and the query to one set of names now lists the query-only names (path, token, the six legacy ones) explicitly.

Tests

  • Locally: unit 7353 of 7355 (the other two expect a writeToDisk EACCES, which root never gets); e2e 229 of 229; lint clean.
  • webpack-dev-server #5750 is updated to the new names on a build of this branch: 980 of 1037, with the same sandbox-only failures as before.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA


Generated by Claude Code

Summary by CodeRabbit

  • Configuration Changes
    • Configure the client endpoint with hot.client.url instead of hot.client.path, and rename urlPrefix to pageParamPrefix.
    • Configure WebSocket server options with hot.ws; provide HTTP server upgrades through attach or handleUpgrade. The hot.server option is no longer supported.
    • Removed deprecated client options including token, hot, liveReload, reload, reconnect, timeout, and autoConnect.
  • Documentation
    • Clarified that legacy query parameters remain readable until the next major release; deprecation warnings apply to this package’s three parameters.

Remove `hot.server` (use `attach` or `handleUpgrade`), `hot.client.token`
(filled in from `hot.token`) and the six legacy `hot.client` keys, which
the entry query still reads. Rename `hot.client.path` to `hot.client.url`
(the query reads both) and `hot.client.urlPrefix` to `pageParamPrefix`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA
@changeset-bot

changeset-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0853be8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 1 package
Name Type
webpack-dev-middleware Minor

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Walkthrough

The client endpoint option changes from path to url, and url takes precedence when both options are supplied. The page parameter prefix changes to pageParamPrefix. The client query continues to read legacy query parameters, while deprecated hot.client options and their warning are removed. The hot.server option and automatic WebSocket attachment to its server are removed; documentation directs upgrade handling through attach or handleUpgrade.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 0853b

The WebSocket upgrade guidance in validation errors is slightly misleading, because it implies handleUpgrade takes the server. Fix the wording and regenerate the snapshots; there is no runtime impact.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: finalizing hot option names before the release.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 10 files. (5 skipped: 5…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.


✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d0bf14c9-bbcf-4839-b593-753325371ebf
📥 Commits

Reviewing files that changed from the base of the PR and between 8a7af5e and 0853be8.

📒 Files selected for processing (16)
  • .changeset/hot-client-apply-and-connect.md
  • .changeset/hot-client-options.md
  • README.md
  • client-src/index.js
  • src/hot.js
  • src/options.check.js
  • src/options.json
  • src/utils.js
  • test/__snapshots__/validation-options.test.js.snap.webpack5
  • test/e2e/client.test.js
  • test/e2e/inject.test.js
  • test/e2e/live-reload.test.js
  • test/e2e/transport.test.js
  • test/inject-client.test.js
  • types/client/index.d.ts
  • types/hot.d.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

* options.hot.transport should be one of these:
"sse" | "ws" | function
-> How events reach the clients: \`sse\`, \`ws\` (needs the optional \`ws\` dependency and an HTTP server to answer upgrades on, given as \`server\` or through the middleware's \`attach\` method), or a function building a transport of your own.
-> How events reach the clients: \`sse\`, \`ws\` (needs the optional \`ws\` dependency and an HTTP server to answer upgrades on, handed over through the middleware's \`attach\` or \`handleUpgrade\` method), or a function building a transport of your own.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
set -eu
rg -n -C 2 'HTTP server to answer upgrades on|handleUpgrade' src/options.json

Repository: webpack/webpack-dev-middleware

Length of output: 558


🏁 Script executed:

set -eu
printf '%s\n' '--- candidate declarations and references ---'
rg -n -F --glob '*.{js,json,ts,d.ts}' -- 'handleUpgrade' src lib types test || test "$?" -eq 1
rg -n -F --glob '*.{js,json,ts,d.ts}' -- 'attach' src lib types test || test "$?" -eq 1
printf '%s\n' '--- source tree candidates ---'
rg --files src lib types 2>/dev/null | head -80

Repository: webpack/webpack-dev-middleware

Length of output: 41154


🏁 Script executed:

set -eu
rg -n -F --glob '!node_modules/**' --glob '!src/options.check.js' -- 'attach(' .
rg -n -F --glob '!node_modules/**' --glob '!src/options.check.js' -- 'attach' types src README.md test 2>/dev/null || test "$?" -eq 1

Repository: webpack/webpack-dev-middleware

Length of output: 11347


Correct the WebSocket upgrade guidance.

The schema wording implies that handleUpgrade receives the HTTP server. Describe attach(server) and handleUpgrade(req, socket, head) separately, then regenerate both validation snapshots.

@codecov

codecov Bot commented Oct 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.54%. Comparing base (8a7af5e) to head (0853be8).

Files with missing lines Patch % Lines
client-src/index.js 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2476      +/-   ##
==========================================
- Coverage   96.55%   96.54%   -0.01%     
==========================================
  Files          24       24              
  Lines        2642     2637       -5     
==========================================
- Hits         2551     2546       -5     
  Misses         91       91              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant