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
6 changes: 3 additions & 3 deletions e2e/dom/fixtures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"react-dom": "^19.2.3"
},
"devDependencies": {
"@rsbuild/core": "^1.7.3",
"@rsbuild/plugin-react": "^1.4.2",
"@testing-library/jest-dom": "^6.9.1",
"@rsbuild/core": "^2.0.0-beta.4",
"@rsbuild/plugin-react": "^1.4.5",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.1",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
Expand Down
10 changes: 5 additions & 5 deletions e2e/mock/fixtures/reRexports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"name": "@rstest/test-mock-re-exports",
"version": "1.0.0",
"devDependencies": {
"@rsbuild/plugin-react": "^1.4.5",
"@rstest/core": "workspace:*",
"@rsbuild/plugin-react": "^1.4.2",
"@testing-library/react": "^16.3.1",
"@types/react": "^18.2.23",
"@types/react-dom": "^18.2.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router": "^6.16.0",
"react-router-dom": "^6.16.0",
"@testing-library/react": "^16.3.1",
"@types/react": "^18.2.23",
"@types/react-dom": "^18.2.8"
"react-router-dom": "^6.16.0"
}
}
4 changes: 2 additions & 2 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@rsbuild/core": "^1.7.3",
"@rsbuild/core": "^2.0.0-beta.4",
"@rsbuild/plugin-react": "^1.4.5",
"@rslib/core": "0.19.4",
"@rsbuild/plugin-react": "^1.4.2",
"@rstest/browser": "workspace:*",
"@rstest/browser-react": "workspace:*",
"@rstest/core": "workspace:*",
Expand Down
8 changes: 4 additions & 4 deletions e2e/projects/fixtures-shard/packages/client-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"vue": "^3.5.26"
},
"devDependencies": {
"@rsbuild/core": "^2.0.0-beta.4",
"@rsbuild/plugin-vue": "^1.2.6",
"@rstest/core": "workspace:*",
"@rsbuild/core": "^1.7.3",
"@rsbuild/plugin-vue": "^1.2.2",
"@vue/test-utils": "^2.4.6",
"@vue/compiler-dom": "^3.5.26",
"@vue/server-renderer": "^3.5.26"
"@vue/server-renderer": "^3.5.26",
"@vue/test-utils": "^2.4.6"
}
}
6 changes: 3 additions & 3 deletions e2e/projects/fixtures-shard/packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"react-dom": "^19.2.3"
},
"devDependencies": {
"@rsbuild/core": "^1.7.3",
"@rsbuild/plugin-react": "^1.4.2",
"@testing-library/jest-dom": "^6.9.1",
"@rsbuild/core": "^2.0.0-beta.4",
"@rsbuild/plugin-react": "^1.4.5",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.1",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
Expand Down
8 changes: 4 additions & 4 deletions e2e/projects/fixtures/packages/client-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"vue": "^3.5.26"
},
"devDependencies": {
"@rsbuild/core": "^2.0.0-beta.4",
"@rsbuild/plugin-vue": "^1.2.6",
"@rstest/core": "workspace:*",
"@rsbuild/core": "^1.7.3",
"@rsbuild/plugin-vue": "^1.2.2",
"@vue/test-utils": "^2.4.6",
"@vue/compiler-dom": "^3.5.26",
"@vue/server-renderer": "^3.5.26"
"@vue/server-renderer": "^3.5.26",
"@vue/test-utils": "^2.4.6"
}
}
6 changes: 3 additions & 3 deletions e2e/projects/fixtures/packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"react-dom": "^19.2.3"
},
"devDependencies": {
"@rsbuild/core": "^1.7.3",
"@rsbuild/plugin-react": "^1.4.2",
"@testing-library/jest-dom": "^6.9.1",
"@rsbuild/core": "^2.0.0-beta.4",
"@rsbuild/plugin-react": "^1.4.5",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.1",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
Expand Down
2 changes: 1 addition & 1 deletion e2e/ssr/fixtures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"react-dom": "^19.2.3"
},
"devDependencies": {
"@rsbuild/plugin-react": "^1.4.2",
"@rsbuild/plugin-react": "^1.4.5",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
"typescript": "^5.9.3"
Expand Down
12 changes: 6 additions & 6 deletions e2e/vue/fixtures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"vue": "^3.5.26"
},
"devDependencies": {
"@rsbuild/core": "^2.0.0-beta.4",
"@rsbuild/plugin-babel": "^1.1.0",
"@rsbuild/plugin-vue": "^1.2.6",
"@rsbuild/plugin-vue-jsx": "^1.1.2",
"@rstest/core": "workspace:*",
"@rsbuild/core": "^1.7.3",
"@rsbuild/plugin-babel": "^1.0.6",
"@rsbuild/plugin-vue": "^1.2.2",
"@rsbuild/plugin-vue-jsx": "^1.1.1",
"@vue/test-utils": "^2.4.6",
"@vue/compiler-dom": "^3.5.26",
"@vue/server-renderer": "^3.5.26"
"@vue/server-renderer": "^3.5.26",
"@vue/test-utils": "^2.4.6"
}
}
2 changes: 1 addition & 1 deletion examples/browser-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"react-dom": "^19.2.3"
},
"devDependencies": {
"@rsbuild/plugin-react": "^1.4.2",
"@rsbuild/plugin-react": "^1.4.5",
"@rstest/browser": "workspace:*",
"@rstest/browser-react": "workspace:*",
"@rstest/core": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions examples/react-rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"react-dom": "^19.2.3"
},
"devDependencies": {
"@rsbuild/core": "^1.7.3",
"@rsbuild/plugin-react": "^1.4.2",
"@rsbuild/core": "^2.0.0-beta.4",
"@rsbuild/plugin-react": "^1.4.5",
"@rstest/adapter-rsbuild": "workspace:*",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
Expand Down
4 changes: 2 additions & 2 deletions examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"react-dom": "^19.2.3"
},
"devDependencies": {
"@rsbuild/core": "^1.7.3",
"@rsbuild/plugin-react": "^1.4.2",
"@rsbuild/core": "^2.0.0-beta.4",
"@rsbuild/plugin-react": "^1.4.5",
"@rstest/core": "workspace:*",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
Expand Down
8 changes: 4 additions & 4 deletions examples/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"vue": "^3.5.26"
},
"devDependencies": {
"@rsbuild/plugin-babel": "^1.0.6",
"@rsbuild/plugin-vue": "^1.2.2",
"@rsbuild/plugin-vue-jsx": "^1.1.1",
"@rsbuild/core": "^1.7.3",
"@rsbuild/core": "^2.0.0-beta.4",
"@rsbuild/plugin-babel": "^1.1.0",
"@rsbuild/plugin-vue": "^1.2.6",
"@rsbuild/plugin-vue-jsx": "^1.1.2",
"@rstest/core": "workspace:*",
"@vue/compiler-dom": "^3.5.26",
"@vue/server-renderer": "^3.5.26",
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"@rstest/core": ">=0.7.7"
},
"devDependencies": {
"@rsbuild/core": "^2.0.0-beta.4",
"@rslib/core": "^0.19.0",
"@rsbuild/core": "^1.7.3",
"@rstest/core": "workspace:*",
"@rstest/tsconfig": "workspace:*"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/browser-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
"node": "^20.19.0 || >=22.12.0"
},
"devDependencies": {
"@rsbuild/core": "^1.7.3",
"@rsbuild/plugin-react": "^1.4.2",
"@rsbuild/plugin-svgr": "^1.2.3",
"@rsbuild/core": "^2.0.0-beta.4",
"@rsbuild/plugin-react": "^1.4.5",
"@rsbuild/plugin-svgr": "^1.3.0",
"@rstest/tsconfig": "workspace:*",
"@tailwindcss/postcss": "^4.1.17",
"@types/react": "^19.2.7",
Expand Down
4 changes: 3 additions & 1 deletion packages/browser-ui/rsbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { pluginSvgr } from '@rsbuild/plugin-svgr';

const root = __dirname;

const isDev = process.argv.includes('dev');

export default defineConfig({
plugins: [pluginReact(), pluginSvgr()],
server: {
Expand All @@ -14,14 +16,14 @@ export default defineConfig({
client: {
port: 7392,
},
assetPrefix: 'http://localhost:7392/',
},
source: {
entry: {
index: './src/main.tsx',
},
},
output: {
assetPrefix: isDev ? 'http://localhost:7392/' : undefined,
distPath: {
js: 'container-static/js',
css: 'container-static/css',
Expand Down
104 changes: 53 additions & 51 deletions packages/browser/src/hostController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1164,70 +1164,72 @@ const createBrowserRuntime = async ({
}
};

devServer.middlewares.use(async (req, res, next) => {
if (!req.url) {
next();
return;
}
const url = new URL(req.url, 'http://localhost');
if (url.pathname === '/__open-in-editor') {
const file = url.searchParams.get('file');
if (!file) {
res.statusCode = 400;
res.end('Missing file');
devServer.middlewares.use(
async (req: IncomingMessage, res: ServerResponse, next: () => void) => {
if (!req.url) {
next();
return;
}
try {
await openEditor([{ file }]);
res.statusCode = 204;
res.end();
} catch (error) {
logger.debug(`[Browser UI] Failed to open editor: ${String(error)}`);
res.statusCode = 500;
res.end('Failed to open editor');
}
return;
}
if (url.pathname === '/') {
if (await respondWithDevServerHtml(url, res)) {
const url = new URL(req.url, 'http://localhost');
if (url.pathname === '/__open-in-editor') {
const file = url.searchParams.get('file');
if (!file) {
res.statusCode = 400;
res.end('Missing file');
return;
}
try {
await openEditor([{ file }]);
res.statusCode = 204;
res.end();
} catch (error) {
logger.debug(`[Browser UI] Failed to open editor: ${String(error)}`);
res.statusCode = 500;
res.end('Failed to open editor');
}
return;
}
if (url.pathname === '/') {
if (await respondWithDevServerHtml(url, res)) {
return;
}

const html =
injectedContainerHtml ||
containerHtmlTemplate?.replace(OPTIONS_PLACEHOLDER, 'null');
const html =
injectedContainerHtml ||
containerHtmlTemplate?.replace(OPTIONS_PLACEHOLDER, 'null');

if (html) {
res.setHeader('Content-Type', 'text/html');
res.end(html);
if (html) {
res.setHeader('Content-Type', 'text/html');
res.end(html);
return;
}

res.statusCode = 502;
res.end('Container UI is not available.');
return;
}
if (url.pathname.startsWith('/container-static/')) {
if (await proxyDevServerAsset(req, res)) {
return;
}

res.statusCode = 502;
res.end('Container UI is not available.');
return;
}
if (url.pathname.startsWith('/container-static/')) {
if (await proxyDevServerAsset(req, res)) {
if (serveContainer) {
serveContainer(req, res, next);
return;
}

res.statusCode = 502;
res.end('Container assets are not available.');
return;
}

if (serveContainer) {
serveContainer(req, res, next);
if (url.pathname === '/runner.html') {
res.setHeader('Content-Type', 'text/html');
res.end(htmlTemplate);
return;
}

res.statusCode = 502;
res.end('Container assets are not available.');
return;
}
if (url.pathname === '/runner.html') {
res.setHeader('Content-Type', 'text/html');
res.end(htmlTemplate);
return;
}
next();
});
next();
},
);

const { port } = await devServer.listen();

Expand Down
7 changes: 4 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"test": "npx rstest --globals"
},
"dependencies": {
"@rsbuild/core": "^1.7.3",
"@rsbuild/core": "^2.0.0-beta.4",
"@types/chai": "^5.2.3",
"tinypool": "^1.1.1"
},
Expand All @@ -69,7 +69,7 @@
"@clack/prompts": "^0.10.1",
"@jridgewell/trace-mapping": "0.3.31",
"@microsoft/api-extractor": "^7.55.2",
"@rsbuild/plugin-node-polyfill": "^1.3.0",
"@rsbuild/plugin-node-polyfill": "^1.4.4",
"@rslib/core": "^0.19.0",
"@rstest/browser-ui": "workspace:*",
"@rstest/tsconfig": "workspace:*",
Expand Down Expand Up @@ -105,7 +105,8 @@
"tinyglobby": "^0.2.15",
"tinyspy": "^4.0.4",
"url-extras": "^0.1.0",
"webpack-license-plugin": "^4.5.1"
"webpack-license-plugin": "^4.5.1",
"webpack": "^5.95.0"
},
"peerDependencies": {
"happy-dom": "*",
Expand Down
Loading
Loading