From 0232e9105c48ce889ac9122efd19106ddde4acd8 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 11 Mar 2026 17:22:01 +0800 Subject: [PATCH 1/4] chore: update Rspack to 2.0.0-beta.6 --- example/package.json | 4 +- package.json | 2 +- pnpm-lock.yaml | 148 ++++--------------------------------------- src/config.ts | 4 +- src/server.ts | 3 +- src/types.ts | 13 +--- 6 files changed, 22 insertions(+), 152 deletions(-) diff --git a/example/package.json b/example/package.json index 5dd7e76..73c4dbd 100644 --- a/example/package.json +++ b/example/package.json @@ -8,8 +8,8 @@ "preview": "rspack preview" }, "devDependencies": { - "@rspack/cli": "2.0.0-beta.5", - "@rspack/core": "2.0.0-beta.5", + "@rspack/cli": "2.0.0-beta.6", + "@rspack/core": "2.0.0-beta.6", "@rspack/dev-server": "workspace:*" } } diff --git a/package.json b/package.json index 4e54e75..dfdb059 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "@biomejs/biome": "^1.9.4", "@hono/node-server": "^1.19.11", "@rslib/core": "^0.20.0", - "@rspack/core": "2.0.0-beta.5", + "@rspack/core": "2.0.0-beta.6", "@rspack/plugin-react-refresh": "1.6.1", "@rstest/core": "^0.9.2", "@types/mime-types": "3.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ff03977..afa832a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -52,8 +52,8 @@ importers: specifier: ^0.20.0 version: 0.20.0(@module-federation/runtime-tools@2.1.0)(core-js@3.47.0)(typescript@5.9.3) '@rspack/core': - specifier: 2.0.0-beta.5 - version: 2.0.0-beta.5(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19) + specifier: 2.0.0-beta.6 + version: 2.0.0-beta.6(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19) '@rspack/plugin-react-refresh': specifier: 1.6.1 version: 1.6.1(react-refresh@0.18.0) @@ -77,7 +77,7 @@ importers: version: 10.1.0 css-loader: specifier: ^7.1.4 - version: 7.1.4(@rspack/core@2.0.0-beta.5(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19))(webpack@5.105.3) + version: 7.1.4(@rspack/core@2.0.0-beta.6(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19))(webpack@5.105.3) express: specifier: ^5.2.1 version: 5.2.1 @@ -130,11 +130,11 @@ importers: example: devDependencies: '@rspack/cli': - specifier: 2.0.0-beta.5 - version: 2.0.0-beta.5(@rspack/core@2.0.0-beta.5(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19))(@rspack/dev-server@) + specifier: 2.0.0-beta.6 + version: 2.0.0-beta.6(@rspack/core@2.0.0-beta.6(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19))(@rspack/dev-server@) '@rspack/core': - specifier: 2.0.0-beta.5 - version: 2.0.0-beta.5(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19) + specifier: 2.0.0-beta.6 + version: 2.0.0-beta.6(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19) '@rspack/dev-server': specifier: workspace:* version: link:.. @@ -526,140 +526,72 @@ packages: typescript: optional: true - '@rspack/binding-darwin-arm64@2.0.0-beta.5': - resolution: {integrity: sha512-PWV/fItbDY9ySPub2YT+DynZLaXeODfzd24SMykUDCfk5U8P/4sK7+7MB8HEN9PeLiM8+iTjHN/XuXti5DzgZA==} - cpu: [arm64] - os: [darwin] - '@rspack/binding-darwin-arm64@2.0.0-beta.6': resolution: {integrity: sha512-FQ8zflthQJJf0cM0vDFnfnXrTOnRvwz886tiafbwu1RO5qmh+pJH+xg1eQaLPnRPqLTlcmnpngyacYFUxw+1AA==} cpu: [arm64] os: [darwin] - '@rspack/binding-darwin-x64@2.0.0-beta.5': - resolution: {integrity: sha512-RfaI0Tf+efGblR2mgqzjKzFxN/NwDqnKsV14YxiwLDxbHFFBy7qSrbeLN+E3xapEaw9x0uTnzcUQDHjekkgXIA==} - cpu: [x64] - os: [darwin] - '@rspack/binding-darwin-x64@2.0.0-beta.6': resolution: {integrity: sha512-Cr4P19anOIaHtK8Z20Hl12PPUcs3LM24ZSQPfs0gPS0etzSOE4JRsqW/79GnnjZd/A+Wola/dZcnMVS44e3c3A==} cpu: [x64] os: [darwin] - '@rspack/binding-linux-arm64-gnu@2.0.0-beta.5': - resolution: {integrity: sha512-Ydbdzji/IFTjPbB5MioBvxsGCpt9uY5W7x9e9c0qadZ5i2wExWjgEoGp0ALiWKPvkNaQo5CAu/0MEwf3C+kf9g==} - cpu: [arm64] - os: [linux] - libc: [glibc] - '@rspack/binding-linux-arm64-gnu@2.0.0-beta.6': resolution: {integrity: sha512-MgTzspaj3v9/4T3KQ/fRuj+cit3BnEcgFe4OP+BvUWlTQvxlckDWpDymVhPuIqpx7pJvLcXwdz8mQhvZ87AD5g==} cpu: [arm64] os: [linux] libc: [glibc] - '@rspack/binding-linux-arm64-musl@2.0.0-beta.5': - resolution: {integrity: sha512-HG1rRjypO2ShKGDbLJA8fqr/DWayo+YbNL3H/aBcv+it02TD2j8j9N2jyKwNpjp4LoMboDtFLOiKjmsLTMf3lQ==} - cpu: [arm64] - os: [linux] - libc: [musl] - '@rspack/binding-linux-arm64-musl@2.0.0-beta.6': resolution: {integrity: sha512-5vyjbrj3u8x4Crb77QvFJSZkq7QwOuVJff8oStbS/v7cC+NEAQQYB/6Bl0JwyDFAcMMX8ZRyaDjc1o1qQ0Q31g==} cpu: [arm64] os: [linux] libc: [musl] - '@rspack/binding-linux-x64-gnu@2.0.0-beta.5': - resolution: {integrity: sha512-R6KCdMwnSXgz8qLZROxpYwSmq7/sLuyvL52TrzCNkMUIl6crfbEfSUAFQGcxMdy6lq5qX8Xir67TzTGMs7fNhw==} - cpu: [x64] - os: [linux] - libc: [glibc] - '@rspack/binding-linux-x64-gnu@2.0.0-beta.6': resolution: {integrity: sha512-GmNJgFHoK5LFQ2m96HrXIgf1zZNe+4yaaOD/5qqcI163QXRqRflfZprmdr2L4R6VsU2i+YQ2Ap2s20Y/zSt6RQ==} cpu: [x64] os: [linux] libc: [glibc] - '@rspack/binding-linux-x64-musl@2.0.0-beta.5': - resolution: {integrity: sha512-McRRtUYjcbGgIrPEJ4doRAdVhg28Y4Y6Bx1FVnIYWvwvZPQvUPT2DHsCnYcnP4P5hp531Oa3ISFz0oU3w10FAA==} - cpu: [x64] - os: [linux] - libc: [musl] - '@rspack/binding-linux-x64-musl@2.0.0-beta.6': resolution: {integrity: sha512-tI2S3v8yXel5GL3yPnBNnFZ/dye4TyRM2j7mfJ49M6uTWjfRFyAcuxqw7z9Pyvyhsc1AoOnnXejtqqJpZkBQoA==} cpu: [x64] os: [linux] libc: [musl] - '@rspack/binding-wasm32-wasi@2.0.0-beta.5': - resolution: {integrity: sha512-4CDqMjcm+d/eTBa35aIAodJnZvy7diYK5n16Dx4erYl+qFfLLSIb/OFP9r+1MFBzWWMRjLORuQUwOMFaGc4m2Q==} - cpu: [wasm32] - '@rspack/binding-wasm32-wasi@2.0.0-beta.6': resolution: {integrity: sha512-Bv9o1zZIDTOzjbliyAwMOGjsL6wiGIPRttJ9CLsdRoKI5XcMTEFHjwlnm1Zs4/EP+zC+bTgseq1EFngIy+nZRg==} cpu: [wasm32] - '@rspack/binding-win32-arm64-msvc@2.0.0-beta.5': - resolution: {integrity: sha512-11RH36VV8rFfImqQ3DiAmYfzAxof3T6xUqjf9JZSJYIavH4R4iDBqLaCBCkuTtdZAUl/Ujv3ziKpQ/bm/mqV/A==} - cpu: [arm64] - os: [win32] - '@rspack/binding-win32-arm64-msvc@2.0.0-beta.6': resolution: {integrity: sha512-R/j0VTVKn3gU4a0xKAXJUX6jzmanHsuBHtLSpgnRqKW/20csFzsnsqY9PxaiAObTHVPMCrNvTG5KXHYIqYgACg==} cpu: [arm64] os: [win32] - '@rspack/binding-win32-ia32-msvc@2.0.0-beta.5': - resolution: {integrity: sha512-XPqt2o2gLmhhEtrG4FgJ8KVNkbJPgGOwbfn3iz5+XjKcmC0ZCvQ1muRIQrhwfNeKaReLoWScFkam5gGcbTK7Gw==} - cpu: [ia32] - os: [win32] - '@rspack/binding-win32-ia32-msvc@2.0.0-beta.6': resolution: {integrity: sha512-v3Gc+gRFTBNLSmyHAgI6mE30W94T0g8jD7S1qamUfX6i50YjDylyiMG1prG/8i/YVNWQynQeQi4Cjfg+Hi7alQ==} cpu: [ia32] os: [win32] - '@rspack/binding-win32-x64-msvc@2.0.0-beta.5': - resolution: {integrity: sha512-Tx9OsnK+GTArCA1dxGnY3EAxjGTr1WSOPs24d0JlFSMpc8AOoDXu5YojE21K6dXnYxBwwb1aVc+aRg3ipS27uQ==} - cpu: [x64] - os: [win32] - '@rspack/binding-win32-x64-msvc@2.0.0-beta.6': resolution: {integrity: sha512-PjaKOG2rQqzOwsmu03EAyTb7oA52CrO1I8JXiBT07adrDysHvKV/Gi+P0XPuDLDMnxNpndoGJMmvfxsymRpwyA==} cpu: [x64] os: [win32] - '@rspack/binding@2.0.0-beta.5': - resolution: {integrity: sha512-gep96+L6yaul0nMUS3RD7w2GkHlx5tgoxvAQ7/zJvI3xrd4UaRY+pnAtfTAr7sBt+y7YQZKHIPvZvHS5omvouQ==} - '@rspack/binding@2.0.0-beta.6': resolution: {integrity: sha512-oJytPDJT57cz2is0e/e1myWVNxn+ZcII1/fF2Y3TiXVUIihLC/KDm6ISTgaZKr8ZyjTlVIV3V4wSO7IHlYV6aw==} - '@rspack/cli@2.0.0-beta.5': - resolution: {integrity: sha512-K6tOBMM95p0a73rdvGtPe2eid3TDROXJb+NvlXDJ8eRnpZkPz0bpRDBLqcmrPSPUMZY4zNlfv6JBUXgm3JpAmA==} + '@rspack/cli@2.0.0-beta.6': + resolution: {integrity: sha512-9nprG9/DMLwfxNASkQY6Rh32dSfJWslEjetFtaogz/lJi80HCX5em550OJGSK3WJhTFoV2rOly8mpW+l2juI2g==} hasBin: true peerDependencies: '@rspack/core': ^2.0.0-0 - '@rspack/dev-server': ~1.2.1 + '@rspack/dev-server': ^2.0.0-0 peerDependenciesMeta: '@rspack/dev-server': optional: true - '@rspack/core@2.0.0-beta.5': - resolution: {integrity: sha512-7qylDEpBxhuoByPjXvKWZYeWSze+mQ54SuU5X9L8EcIjY22rWe/NcmyVHBkbUt5XC1cKP+nrCZMp9eNCBq3/Bg==} - engines: {node: ^20.19.0 || >=22.12.0} - peerDependencies: - '@module-federation/runtime-tools': ^0.24.1 || ^2.0.0 - '@swc/helpers': '>=0.5.1' - peerDependenciesMeta: - '@module-federation/runtime-tools': - optional: true - '@swc/helpers': - optional: true - '@rspack/core@2.0.0-beta.6': resolution: {integrity: sha512-dvi10ijR9Rr0W75GRFqWvswAEdLBsbXCGhxzm6zXxFNSanNL9s9xPelZ8XfnIU13QZkN2VNHGl9O/8KQEmYdEw==} engines: {node: ^20.19.0 || >=22.12.0} @@ -2469,83 +2401,38 @@ snapshots: - '@typescript/native-preview' - core-js - '@rspack/binding-darwin-arm64@2.0.0-beta.5': - optional: true - '@rspack/binding-darwin-arm64@2.0.0-beta.6': optional: true - '@rspack/binding-darwin-x64@2.0.0-beta.5': - optional: true - '@rspack/binding-darwin-x64@2.0.0-beta.6': optional: true - '@rspack/binding-linux-arm64-gnu@2.0.0-beta.5': - optional: true - '@rspack/binding-linux-arm64-gnu@2.0.0-beta.6': optional: true - '@rspack/binding-linux-arm64-musl@2.0.0-beta.5': - optional: true - '@rspack/binding-linux-arm64-musl@2.0.0-beta.6': optional: true - '@rspack/binding-linux-x64-gnu@2.0.0-beta.5': - optional: true - '@rspack/binding-linux-x64-gnu@2.0.0-beta.6': optional: true - '@rspack/binding-linux-x64-musl@2.0.0-beta.5': - optional: true - '@rspack/binding-linux-x64-musl@2.0.0-beta.6': optional: true - '@rspack/binding-wasm32-wasi@2.0.0-beta.5': - dependencies: - '@napi-rs/wasm-runtime': 1.0.7 - optional: true - '@rspack/binding-wasm32-wasi@2.0.0-beta.6': dependencies: '@napi-rs/wasm-runtime': 1.0.7 optional: true - '@rspack/binding-win32-arm64-msvc@2.0.0-beta.5': - optional: true - '@rspack/binding-win32-arm64-msvc@2.0.0-beta.6': optional: true - '@rspack/binding-win32-ia32-msvc@2.0.0-beta.5': - optional: true - '@rspack/binding-win32-ia32-msvc@2.0.0-beta.6': optional: true - '@rspack/binding-win32-x64-msvc@2.0.0-beta.5': - optional: true - '@rspack/binding-win32-x64-msvc@2.0.0-beta.6': optional: true - '@rspack/binding@2.0.0-beta.5': - optionalDependencies: - '@rspack/binding-darwin-arm64': 2.0.0-beta.5 - '@rspack/binding-darwin-x64': 2.0.0-beta.5 - '@rspack/binding-linux-arm64-gnu': 2.0.0-beta.5 - '@rspack/binding-linux-arm64-musl': 2.0.0-beta.5 - '@rspack/binding-linux-x64-gnu': 2.0.0-beta.5 - '@rspack/binding-linux-x64-musl': 2.0.0-beta.5 - '@rspack/binding-wasm32-wasi': 2.0.0-beta.5 - '@rspack/binding-win32-arm64-msvc': 2.0.0-beta.5 - '@rspack/binding-win32-ia32-msvc': 2.0.0-beta.5 - '@rspack/binding-win32-x64-msvc': 2.0.0-beta.5 - '@rspack/binding@2.0.0-beta.6': optionalDependencies: '@rspack/binding-darwin-arm64': 2.0.0-beta.6 @@ -2559,21 +2446,14 @@ snapshots: '@rspack/binding-win32-ia32-msvc': 2.0.0-beta.6 '@rspack/binding-win32-x64-msvc': 2.0.0-beta.6 - '@rspack/cli@2.0.0-beta.5(@rspack/core@2.0.0-beta.5(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19))(@rspack/dev-server@)': + '@rspack/cli@2.0.0-beta.6(@rspack/core@2.0.0-beta.6(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19))(@rspack/dev-server@)': dependencies: '@discoveryjs/json-ext': 0.5.7 - '@rspack/core': 2.0.0-beta.5(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19) + '@rspack/core': 2.0.0-beta.6(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19) exit-hook: 4.0.0 optionalDependencies: '@rspack/dev-server': 'link:' - '@rspack/core@2.0.0-beta.5(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19)': - dependencies: - '@rspack/binding': 2.0.0-beta.5 - optionalDependencies: - '@module-federation/runtime-tools': 2.1.0 - '@swc/helpers': 0.5.19 - '@rspack/core@2.0.0-beta.6(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19)': dependencies: '@rspack/binding': 2.0.0-beta.6 @@ -2990,7 +2870,7 @@ snapshots: shebang-command: 2.0.0 which: 2.0.2 - css-loader@7.1.4(@rspack/core@2.0.0-beta.5(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19))(webpack@5.105.3): + css-loader@7.1.4(@rspack/core@2.0.0-beta.6(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19))(webpack@5.105.3): dependencies: icss-utils: 5.1.0(postcss@8.4.47) postcss: 8.4.47 @@ -3001,7 +2881,7 @@ snapshots: postcss-value-parser: 4.2.0 semver: 7.7.3 optionalDependencies: - '@rspack/core': 2.0.0-beta.5(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19) + '@rspack/core': 2.0.0-beta.6(@module-federation/runtime-tools@2.1.0)(@swc/helpers@0.5.19) webpack: 5.105.3 cssesc@3.0.0: {} diff --git a/src/config.ts b/src/config.ts index 285366a..6be1aa4 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,9 +1,9 @@ +import type { DevServerOpenOptions } from '@rspack/core'; import type { ClientConfiguration, ConnectHistoryApiFallbackOptions, DevServer, NormalizedStatic, - Open, ServerConfiguration, WatchFiles, WebSocketServerConfiguration, @@ -15,7 +15,7 @@ export interface ResolvedDevServer extends DevServer { devMiddleware: DevServer['devMiddleware']; hot: boolean | 'only'; host?: string; - open: Open[]; + open: DevServerOpenOptions; magicHtml: boolean; liveReload: boolean; webSocketServer: false | WebSocketServerConfiguration; diff --git a/src/server.ts b/src/server.ts index 68862ca..f54ac7c 100644 --- a/src/server.ts +++ b/src/server.ts @@ -50,7 +50,6 @@ import type { NormalizedStatic, Open, OpenApp, - OpenOptions, OverlayMessageOptions, Port, ProxyConfigArray, @@ -1069,7 +1068,7 @@ class Server< ? ([ { target: '', - options: defaultOpenOptions as OpenOptions, + options: defaultOpenOptions, }, ] as NormalizedOpen[]) : []; diff --git a/src/types.ts b/src/types.ts index bab890b..48fe678 100644 --- a/src/types.ts +++ b/src/types.ts @@ -16,6 +16,7 @@ import type { RequestHandler, } from 'http-proxy-middleware'; import type { ServeStaticOptions } from 'serve-static'; +import type { DevServerOpenOptions } from '@rspack/core'; export type { FSWatcher, @@ -168,7 +169,7 @@ export interface Open { export interface NormalizedOpen { target: string; - options: OpenOptions; + options: DevServerOpenOptions; } export interface WebSocketURL { @@ -226,13 +227,3 @@ function useFn( export type BasicApplication = { use: typeof useFn; }; - -// Type definition matching open package's Options type -// (Cannot import directly from ES module in CommonJS context) -export type OpenOptions = { - readonly wait?: boolean; - readonly background?: boolean; - readonly newInstance?: boolean; - readonly app?: OpenApp | readonly OpenApp[]; - readonly allowNonzeroExitCode?: boolean; -}; From a1c77d5fd47ab667d2a095831fbf706a89d5d994 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 11 Mar 2026 17:25:17 +0800 Subject: [PATCH 2/4] fix --- src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.ts b/src/types.ts index 48fe678..ed2e95d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -4,6 +4,7 @@ import type { ServerResponse, } from 'node:http'; import type { ServerOptions } from 'node:https'; +import type { DevServerOpenOptions } from '@rspack/core'; import type { FSWatcher, ChokidarOptions as WatchOptions } from 'chokidar'; import type { Options as ConnectHistoryApiFallbackOptions } from 'connect-history-api-fallback'; import type { @@ -16,7 +17,6 @@ import type { RequestHandler, } from 'http-proxy-middleware'; import type { ServeStaticOptions } from 'serve-static'; -import type { DevServerOpenOptions } from '@rspack/core'; export type { FSWatcher, From 5e850861653d6e469315a559bb94bac1b6efc879 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 11 Mar 2026 17:29:59 +0800 Subject: [PATCH 3/4] fix --- src/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index 6be1aa4..51837fb 100644 --- a/src/config.ts +++ b/src/config.ts @@ -15,7 +15,7 @@ export interface ResolvedDevServer extends DevServer { devMiddleware: DevServer['devMiddleware']; hot: boolean | 'only'; host?: string; - open: DevServerOpenOptions; + open: DevServerOpenOptions[]; magicHtml: boolean; liveReload: boolean; webSocketServer: false | WebSocketServerConfiguration; From b4cd7e10bfe118f4346d593a810ee9efb86b8d38 Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 12 Mar 2026 10:43:10 +0800 Subject: [PATCH 4/4] fix --- tests/e2e/__snapshots__/web-socket-communication.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/__snapshots__/web-socket-communication.test.js.snap b/tests/e2e/__snapshots__/web-socket-communication.test.js.snap index aa72da4..6efe539 100644 --- a/tests/e2e/__snapshots__/web-socket-communication.test.js.snap +++ b/tests/e2e/__snapshots__/web-socket-communication.test.js.snap @@ -23,7 +23,7 @@ exports[`web socket communication > should work and reconnect when the connectio "[HMR] Checking for updates on the server...", "Failed to load resource: the server responded with a status of 404 (Not Found)", "[HMR] Cannot find update. Need to do a full reload!", - "[HMR] (Probably because of restarting the webpack-dev-server)", + "[HMR] (Probably because of restarting the rspack-dev-server)", "Failed to load resource: the server responded with a status of 404 (Not Found)", ] `;