Skip to content

Conversation

@LingyuCoder
Copy link
Contributor

Summary

This PR ports the core functionality from webpack-dev-server@5 to @rspack/dev-server to provide a comprehensive development server experience for Rspack users. The porting effort includes:

  • Client-side code: Ported client modules including WebSocket/SockJS clients, overlay, progress indicators, and logger utilities to support hot module replacement (HMR) and live reloading features
  • Server implementation: Added WebSocket server implementations (SockJS and WebSocket) with a base server abstraction
  • Configuration: Integrated comprehensive dev server options schema and configuration handling
  • Build infrastructure: Added build scripts for client modules to ensure proper bundling and distribution

This change enables @rspack/dev-server to offer feature parity with webpack-dev-server, allowing developers to seamlessly migrate from webpack to Rspack while maintaining the same development experience. The implementation follows the same architecture and patterns as webpack-dev-server, ensuring compatibility and familiarity for existing users.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings January 13, 2026 08:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ports the core functionality from webpack-dev-server@5 to @rspack/dev-server to provide feature parity for Rspack users. The implementation includes:

Changes:

  • Removed dependency on webpack-dev-server and implemented core server functionality directly
  • Added comprehensive server implementations (WebSocket, SockJS) with base abstractions
  • Ported client-side modules for HMR, overlay, progress indicators, and WebSocket communication
  • Added build infrastructure for client modules bundling
  • Updated configuration schema and type definitions

Reviewed changes

Copilot reviewed 41 out of 45 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/server.ts Complete rewrite implementing dev server from scratch
src/servers/*.ts New WebSocket server implementations (BaseServer, WebsocketServer, SockJSServer)
src/getPort.ts New port allocation utility
src/patch.ts Removed (no longer needed with native implementation)
src/index.ts Updated to export new Server class
src/options.json New comprehensive dev server options schema
client-src/*.ts New client-side modules for HMR and dev server communication
scripts/build-client-modules.cjs New build script for client module bundling
tsconfig*.json Updated TypeScript configurations
package.json Updated dependencies and exports
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we update the credits to clarify that this project is forked from webpack-dev-server?

https://github.com/rstackjs/rspack-dev-server?tab=readme-ov-file#credits

@LingyuCoder
Copy link
Contributor Author

Could we update the credits to clarify that this project is forked from webpack-dev-server?

rstackjs/rspack-dev-server#credits

Done

@LingyuCoder LingyuCoder merged commit 02ad09c into main Jan 13, 2026
10 of 12 checks passed
@LingyuCoder LingyuCoder deleted the feat/port-webpack-dev-server branch January 13, 2026 12:22
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.

3 participants