Skip to content

feat(client): bring the error overlay to parity with webpack-dev-server#2353

Draft
bjohansebas wants to merge 1 commit into
hot-middlewarefrom
feat/hot-overlay-csp
Draft

feat(client): bring the error overlay to parity with webpack-dev-server#2353
bjohansebas wants to merge 1 commit into
hot-middlewarefrom
feat/hot-overlay-csp

Conversation

@bjohansebas

Copy link
Copy Markdown
Member
  • Render inside an about:blank iframe and style exclusively through the CSSOM so the overlay works under a strict style-src CSP; inline styles from ansi-html are re-applied via style.cssText.
  • Support Trusted Types: innerHTML writes go through a policy (configurable via overlayTrustedTypesPolicyName).
  • Capture uncaught runtime errors and unhandled rejections in the overlay (overlayRuntimeErrors, default true), with the same React error boundary heuristic as dev-server.
  • Inline the HTML entity encoder and drop the html-entities dependency.
  • Expose the overlay as a standalone subpath export (webpack-dev-middleware/client/overlay) so webpack-dev-server can reuse it.

Ref webpack/webpack-hot-middleware#457

Summary

What kind of change does this PR introduce?

Did you add tests for your changes?

Does this PR introduce a breaking change?

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

Use of AI

- Render inside an about:blank iframe and style exclusively through
  the CSSOM so the overlay works under a strict style-src CSP; inline
  styles from ansi-html are re-applied via style.cssText.
- Support Trusted Types: innerHTML writes go through a policy
  (configurable via overlayTrustedTypesPolicyName).
- Capture uncaught runtime errors and unhandled rejections in the
  overlay (overlayRuntimeErrors, default true), with the same React
  error boundary heuristic as dev-server.
- Inline the HTML entity encoder and drop the html-entities dependency.
- Expose the overlay as a standalone subpath export
  (webpack-dev-middleware/client/overlay) so webpack-dev-server can
  reuse it.

Ref webpack/webpack-hot-middleware#457
@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9b8c387

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

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.23%. Comparing base (52f4d31) to head (9b8c387).

Additional details and impacted files
@@                Coverage Diff                 @@
##           hot-middleware    #2353      +/-   ##
==================================================
- Coverage           93.57%   93.23%   -0.34%     
==================================================
  Files                   4        4              
  Lines                1182     1182              
  Branches              354      354              
==================================================
- Hits                 1106     1102       -4     
- Misses                 68       72       +4     
  Partials                8        8              

☔ 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.

@bjohansebas bjohansebas marked this pull request as draft July 14, 2026 05:20
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