Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the plugin-maintained error overlay feature from @rspack/plugin-react-refresh (option, runtime entry, socket integrations, public exports, and related tests/docs) to rely on dev-server/Rsbuild overlays instead.
Changes:
- Dropped the
overlayoption and all associated runtime/socket integration code paths. - Removed the published
./overlayexport and cleaned up dependencies/lockfile entries that were only used by the overlay. - Updated docs, example config, and tests to reflect the removal.
Reviewed changes
Copilot reviewed 34 out of 35 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| THIRDPARTY.md | Removes third-party attribution that was only required for the overlay ANSI utilities. |
| test/test.spec.ts | Drops overlay/socket-integration-specific test coverage. |
| src/utils/getSocketIntegration.ts | Removes socket integration resolution utility (overlay-related). |
| src/utils/getIntegrationEntry.ts | Removes integration entry resolver (overlay-related). |
| src/utils/getAdditionalEntries.ts | Removes logic that injected overlay runtime entries. |
| src/sockets/WHMEventSource.ts | Removes webpack-hot-middleware socket bridge. |
| src/sockets/WDSSocket.ts | Removes webpack-dev-server socket bridge. |
| src/sockets/utils/getWDSMetadata.ts | Removes WDS client metadata detection (overlay-related). |
| src/sockets/utils/getUrlFromParts.ts | Removes socket URL construction helper. |
| src/sockets/utils/getSocketUrlParts.ts | Removes socket URL parsing/derivation logic (overlay-related). |
| src/sockets/utils/getCurrentScriptSource.ts | Removes script source helper used for socket URL recovery. |
| src/options.ts | Removes overlay option types/normalization and simplifies normalized options typing. |
| src/index.ts | Removes overlay entry/socket injection and overlay-related Provide/Define wiring; always injects react-refresh entry only. |
| rslib.config.mts | Removes build config that emitted CJS artifacts for socket modules. |
| README.md | Removes user-facing documentation for the overlay option. |
| pnpm-lock.yaml | Removes overlay-only dependencies from the lockfile. |
| package.json | Removes ./overlay export and overlay-only deps/peer deps. |
| example/rspack.config.ts | Removes overlay: true usage from the example. |
| client/utils/retry.js | Removes retry helper used for overlay socket initialization. |
| client/utils/formatWebpackErrors.js | Removes error formatting helper used by overlay compile errors. |
| client/utils/errorEventHandlers.js | Removes runtime error event hook helpers used by overlay. |
| client/utils/ansi-html.js | Removes ANSI-to-HTML converter used by overlay UI. |
| client/refreshUtils.js | Removes overlay interactions from refresh runtime and makes refresh callback optional. |
| client/reactRefresh.js | Removes overlay plumbing when invoking executeRuntime. |
| client/overlay/utils.js | Removes overlay DOM helpers. |
| client/overlay/theme.js | Removes overlay theme constants. |
| client/overlay/index.js | Removes overlay UI implementation. |
| client/overlay/containers/RuntimeErrorContainer.js | Removes overlay runtime error container. |
| client/overlay/containers/CompileErrorContainer.js | Removes overlay compile error container. |
| client/overlay/components/RuntimeErrorStack.js | Removes overlay stack rendering component. |
| client/overlay/components/RuntimeErrorHeader.js | Removes overlay header component. |
| client/overlay/components/RuntimeErrorFooter.js | Removes overlay footer/pagination component. |
| client/overlay/components/PageHeader.js | Removes overlay page header component. |
| client/overlay/components/CompileErrorTrace.js | Removes overlay compile error trace component. |
| client/errorOverlayEntry.js | Removes overlay runtime entry that wired sockets + overlay rendering. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove the
overlayoption from@rspack/plugin-react-refresh, along with its runtime, socket integration, public export, and related tests/docs.Background
Rspack dev server and Rsbuild already provide maintained overlay implementations. Keeping another overlay in this plugin introduces overlapping behavior and can result in duplicate overlays in the browser.
The plugin overlay is disabled by default and not part of the common workflow, yet it adds notable maintenance cost. It also has known issues with HMR recovery and ANSI rendering. Relying on the built-in overlays provides a more stable and consistent experience, so this plugin no longer maintains a separate implementation.