Skip to content

refactor: reuse dev-middleware overlay and progress indicator - #5735

Draft
bjohansebas wants to merge 4 commits into
mainfrom
refactor/dev-middleware-client-ui
Draft

refactor: reuse dev-middleware overlay and progress indicator#5735
bjohansebas wants to merge 4 commits into
mainfrom
refactor/dev-middleware-client-ui

Conversation

@bjohansebas

Copy link
Copy Markdown
Member

Summary

Reuse the overlay and compilation progress indicator exported by webpack-dev-middleware 8.3.0. This removes the duplicated overlay state machine, runtime error listeners, and progress element from the dev-server client.

The shared overlay handles pagination, dismissal, and runtime errors. The client retains webpack diagnostic formatting and resolves editor links to module paths across pages. client.progress: true, "linear", and "circular" now enable the shared indicator alongside progress logging.

What kind of change does this PR introduce?

Refactor with client UI and runtime error filtering changes.

Did you add tests for your changes?

Yes. Added jsdom coverage for shared overlays, pagination with buttons and arrow keys, editor links, replacement and dismissal of build errors, and progress indicator lifecycle. Updated runtime error tests and complete HTML/style snapshots, including pagination controls.

Client tests, client type checking, targeted lint checks, and the client build passed. All 35 overlay e2e tests passed before the final runtime-listener cleanup; the final e2e change for an explicit error cause is left for CI.

Does this PR introduce a breaking change?

Yes. The overlay DOM and progress UI now come from webpack-dev-middleware; "linear" and "circular" no longer select distinct indicator styles, and true also enables the visual indicator. Integrations targeting the old overlay or progress selectors need to use the shared components' DOM.

Runtime error filters receive the middleware's normalized error. To inspect a rejected object's data through error.cause, reject an Error with an explicit cause, for example Promise.reject(new Error("Request failed", { cause: details })). Rejecting a plain object no longer automatically places that object in error.cause.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Document the shared progress indicator behavior and the explicit Error.cause requirement for runtime error filters. No documentation changes are included in this PR.

Use of AI

OpenAI Codex assisted with implementation, tests, snapshot updates, validation, and drafting this PR description. The contributor directed the work through iterative feedback on reuse of middleware functionality, pagination, and snapshot coverage.

@changeset-bot

changeset-bot Bot commented Sep 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 66da6ab

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 no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedmemfs@​4.57.1 ⏵ 4.71.098 +110093 +196 +2100
Updatedwebpack-dev-middleware@​8.0.3 ⏵ 8.3.09910010097 +2100

View full report

@bjohansebas
bjohansebas marked this pull request as draft September 6, 2026 04:53
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