Skip to content

Commit fc36a59

Browse files
refactor(client): take the error overlay from dev-middleware too
692 lines of overlay deleted in favour of the one dev-middleware ships — the state machine, the iframe, the rendering, the runtime-error listeners. What is left is an adapter: this package's `createOverlay`/`send` shape on top of that overlay's `showProblems`/`clear`, plus `formatProblem`, which stays because the console uses it and because this package still receives webpack's error objects rather than formatted strings. Three things had to be carried across so nothing outward changes: * the element id. It is what a test, a screenshot tool or an integration finds the overlay by, so `webpack-dev-server-client-overlay` is passed through dev-middleware's new `overlay.id` rather than renamed; * the Trusted Types policy name. Under an enforced `require-trusted-types-for 'script'` the page's CSP allowlists a policy by name, and dev-middleware's default is a different one, so `webpack-dev-server#overlay` is passed explicitly — including where this package's option is `false`, which means "no name of my own"; * `/webpack-dev-server/open-editor`. dev-middleware leaves the endpoint empty by default, having no route to point at, so the file references in a problem would have stopped being clickable. The first two came from the e2e suite failing, not from reading the code, which is the argument for swapping under the tests rather than after. What does change is the overlay's internal DOM, which is not an interface this package documents: a clickable file reference is `[data-open-file]` rather than `[data-can-open]`, and a problem is headed by its level and origin rather than "Compiled with problems". Two tests assert on those and move with the implementation. Checked against a baseline taken first: the overlay suite fails exactly the set it fails on a clean `main` in this container — no case newly failing, none newly passing — and the client and web-socket-url suites are unmoved. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA
1 parent 0ae6bb3 commit fc36a59

4 files changed

Lines changed: 1975 additions & 2635 deletions

File tree

0 commit comments

Comments
 (0)