Repository navigation
Commit 931ef71
feat: reuse webpack-dev-middleware's browser runtime
This server has no client of its own any more. `client-src/` is gone — the
runtime, the error overlay, the progress indicator, the logger, the socket
wrapper and the WebSocket client, around two thousand lines that existed in
near-duplicate in both projects — and the middleware's hot option drives all
of it, including putting the entry and `HotModuleReplacementPlugin` into the
compilation.
Nothing about a configuration changes. Every option keeps its name and its
meaning and is mapped onto the middleware's vocabulary in `lib/hotOptions.js`:
`hot`/`liveReload` become one `apply` mode, `client.reconnect` becomes
`connect.retries`, `client.webSocketURL` is already the shape the middleware's
`hot.client.path` takes, and the overlay is passed through with this project's
own element id so anything querying for it still finds it.
The `webpack-dev-server/client/*` paths are generated re-exports of the
middleware's client, so importing them resolves to what it always did. The
paths that were only this bundle's internals are no longer published.
Protection stays here. `allowedHosts`, the `Origin` checks and the same-origin
rule are unchanged: the middleware is handed `cors: true` and no token, which
is it applying no policy of its own, and every connection is judged here
before anything is published to it. A handshake is refused before it completes
rather than after, since the middleware exposes the upgrade rather than taking
the server over.
A `webSocketServer` of your own still works. A class, a module exporting one,
or options giving the socket a port or a server of its own are wrapped into
the shape the middleware asks a custom transport for, so there is one path
from a build to a page either way, and `BaseServer` keeps its export.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA1 parent 802c20d commit 931ef71
42 files changed
Lines changed: 708 additions & 3589 deletions
File tree
- .changeset
- client-src
- clients
- modules/logger
- utils
- lib
- servers
- scripts
- test
- client
- __snapshots__
- clients
- __snapshots__
- utils
- __snapshots__
- e2e
- types/lib/servers
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
266 | 269 | | |
267 | 270 | | |
268 | 271 | | |
| |||
This file was deleted.
This file was deleted.
0 commit comments