Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client-src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ const reloadApp = (
}

const search = self.location.search.toLowerCase();
const allowToHot = search.indexOf('webpack-dev-server-hot=false') === -1;
const allowToHot = search.indexOf('rspack-dev-server-hot=false') === -1;
const allowToLiveReload =
search.indexOf('webpack-dev-server-live-reload=false') === -1;
search.indexOf('rspack-dev-server-live-reload=false') === -1;

if (hot && allowToHot) {
log.info('App hot update...');
Expand Down
8 changes: 4 additions & 4 deletions client-src/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,15 +460,15 @@ const createOverlay = (options: CreateOverlayOptions): StateMachine => {
// Enable Trusted Types if they are available in the current browser.
if (window.trustedTypes) {
overlayTrustedTypesPolicy = window.trustedTypes.createPolicy(
trustedTypesPolicyName || 'webpack-dev-server#overlay',
trustedTypesPolicyName || 'rspack-dev-server#overlay',
{
createHTML: (value: string) => value,
},
);
}

iframeContainerElement = document.createElement('iframe');
iframeContainerElement.id = 'webpack-dev-server-client-overlay';
iframeContainerElement.id = 'rspack-dev-server-client-overlay';
iframeContainerElement.src = 'about:blank';
applyStyle(iframeContainerElement, iframeStyle);

Expand All @@ -480,7 +480,7 @@ const createOverlay = (options: CreateOverlayOptions): StateMachine => {
iframeContainerElement?.contentDocument as Document
).createElement('div');

contentElement.id = 'webpack-dev-server-client-overlay-div';
contentElement.id = 'rspack-dev-server-client-overlay-div';
applyStyle(contentElement, containerStyle);

headerElement = document.createElement('div');
Expand Down Expand Up @@ -590,7 +590,7 @@ const createOverlay = (options: CreateOverlayOptions): StateMachine => {
typeElement.setAttribute('data-can-open', 'true');
typeElement.addEventListener('click', () => {
fetch(
`/webpack-dev-server/open-editor?fileName=${message.moduleIdentifier}`,
`/rspack-dev-server/open-editor?fileName=${message.moduleIdentifier}`,
);
});
}
Expand Down
12 changes: 6 additions & 6 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1775,8 +1775,8 @@ class Server<

// Should be after `webpack-dev-middleware`, otherwise other middlewares might rewrite response
middlewares.push({
name: 'webpack-dev-server-sockjs-bundle',
path: '/__webpack_dev_server__/sockjs.bundle.js',
name: 'rspack-dev-server-sockjs-bundle',
path: '/__rspack_dev_server__/sockjs.bundle.js',
middleware: (req: Request, res: Response, next: NextFunction) => {
if (req.method !== 'GET' && req.method !== 'HEAD') {
next();
Expand Down Expand Up @@ -1818,8 +1818,8 @@ class Server<
});

middlewares.push({
name: 'webpack-dev-server-invalidate',
path: '/webpack-dev-server/invalidate',
name: 'rspack-dev-server-invalidate',
path: '/rspack-dev-server/invalidate',
middleware: (req: Request, res: Response, next: NextFunction) => {
if (req.method !== 'GET' && req.method !== 'HEAD') {
next();
Expand All @@ -1833,8 +1833,8 @@ class Server<
});

middlewares.push({
name: 'webpack-dev-server-open-editor',
path: '/webpack-dev-server/open-editor',
name: 'rspack-dev-server-open-editor',
path: '/rspack-dev-server/open-editor',
middleware: (req: Request, res: Response, next: NextFunction) => {
if (req.method !== 'GET' && req.method !== 'HEAD') {
next();
Expand Down
2 changes: 1 addition & 1 deletion src/servers/SockJSServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class SockJSServer extends BaseServer {
return options.sockjsUrl;
}

return '/__webpack_dev_server__/sockjs.bundle.js';
return '/__rspack_dev_server__/sockjs.bundle.js';
};

this.implementation = sockjs.createServer({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ exports[`hot and live reload > should not refresh content when hot and no live r

exports[`hot and live reload > should not refresh content when hot and no live reload disabled (ws) > page errors 1`] = `[]`;

exports[`hot and live reload > should work and allow to disable hot module replacement and live reload using the "webpack-dev-server-hot=false&webpack-dev-server-live-reload=false" (default) > console messages 1`] = `
exports[`hot and live reload > should work and allow to disable hot module replacement and live reload using the "rspack-dev-server-hot=false&rspack-dev-server-live-reload=false" (default) > console messages 1`] = `
[
[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.,
[HMR] Waiting for update signal from WDS...,
[rspack-dev-server] App updated. Recompiling...,
]
`;

exports[`hot and live reload > should work and allow to disable hot module replacement and live reload using the "webpack-dev-server-hot=false&webpack-dev-server-live-reload=false" (default) > page errors 1`] = `[]`;
exports[`hot and live reload > should work and allow to disable hot module replacement and live reload using the "rspack-dev-server-hot=false&rspack-dev-server-live-reload=false" (default) > page errors 1`] = `[]`;

exports[`hot and live reload > should work and allow to disable hot module replacement using the "webpack-dev-server-hot=false" (default) > console messages 1`] = `
exports[`hot and live reload > should work and allow to disable hot module replacement using the "rspack-dev-server-hot=false" (default) > console messages 1`] = `
[
[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.,
[HMR] Waiting for update signal from WDS...,
Expand All @@ -48,16 +48,16 @@ exports[`hot and live reload > should work and allow to disable hot module repla
]
`;

exports[`hot and live reload > should work and allow to disable hot module replacement using the "webpack-dev-server-hot=false" (default) > page errors 1`] = `[]`;
exports[`hot and live reload > should work and allow to disable hot module replacement using the "rspack-dev-server-hot=false" (default) > page errors 1`] = `[]`;

exports[`hot and live reload > should work and allow to disable live reload using the "webpack-dev-server-live-reload=false" (default) > console messages 1`] = `
exports[`hot and live reload > should work and allow to disable live reload using the "rspack-dev-server-live-reload=false" (default) > console messages 1`] = `
[
[rspack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.,
[rspack-dev-server] App updated. Recompiling...,
]
`;

exports[`hot and live reload > should work and allow to disable live reload using the "webpack-dev-server-live-reload=false" (default) > page errors 1`] = `[]`;
exports[`hot and live reload > should work and allow to disable live reload using the "rspack-dev-server-live-reload=false" (default) > page errors 1`] = `[]`;

exports[`hot and live reload > should work and do nothing when web socket server disabled (default) > console messages 1`] = `[]`;

Expand Down
Loading