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
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: '24.15.0'
node-version: '24.16.0'
Comment thread
SyMind marked this conversation as resolved.
package-manager-cache: false

- name: Install Pnpm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: '24.15.0'
node-version: '24.16.0'
package-manager-cache: false

- name: Install Pnpm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: '24.15.0'
node-version: '24.16.0'
package-manager-cache: false

- name: Install Pnpm
Expand Down
10 changes: 5 additions & 5 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
},
"devDependencies": {
"@e2e/helper": "workspace:*",
"@rsbuild/core": "^2.0.6",
"@rsbuild/plugin-react": "^2.0.0",
"@rsbuild/core": "^2.0.12",
"@rsbuild/plugin-react": "^2.0.1",
"@types/express": "^5.0.6",
"@types/webpack-env": "^1.18.8",
"cross-env": "^10.1.0",
"express": "^5.2.1",
"rsbuild-plugin-rsc": "workspace:*",
"srvx": "^0.11.15"
"srvx": "^0.11.16"
},
"dependencies": {
"react": "^19.2.6",
"react-dom": "^19.2.6"
"react": "^19.2.7",
"react-dom": "^19.2.7"
}
}
10 changes: 5 additions & 5 deletions examples/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
"preview": "node server.js"
},
"dependencies": {
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"react-server-dom-rspack": "0.0.2",
"rsc-html-stream": "^0.0.7"
},
"devDependencies": {
"@rsbuild/core": "^2.0.6",
"@rsbuild/plugin-react": "^2.0.0",
"@rsbuild/core": "^2.0.12",
"@rsbuild/plugin-react": "^2.0.1",
"@types/express": "^5.0.6",
"@types/webpack-env": "^1.18.8",
"express": "^5.2.1",
"rsbuild-plugin-rsc": "workspace:*",
"srvx": "^0.9.8"
"srvx": "^0.11.16"
}
}
7 changes: 6 additions & 1 deletion examples/client/server/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import {
import { toNodeHandler } from 'srvx/node';
import { RSC } from './RSC';

type NodeRequestHandler = (
req: IncomingMessage,
res: ServerResponse<IncomingMessage>,
) => void | Promise<void>;

export type RscPayload = {
root: React.ReactNode;
returnValue?: { ok: boolean; data: unknown };
Expand Down Expand Up @@ -42,7 +47,7 @@ async function handler(): Promise<Response> {
});
}

const fetch = toNodeHandler(() => handler());
const fetch = toNodeHandler(() => handler()) as NodeRequestHandler;

async function nodeHandler(
req: IncomingMessage,
Expand Down
14 changes: 7 additions & 7 deletions examples/react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
"preview": "node server.js"
},
"dependencies": {
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-router": "^7.13.1",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"react-router": "^7.17.0",
"react-server-dom-rspack": "0.0.2"
},
"devDependencies": {
"@rsbuild/core": "^2.0.6",
"@rsbuild/plugin-react": "^2.0.0",
"@rsbuild/core": "^2.0.12",
"@rsbuild/plugin-react": "^2.0.1",
"@types/express": "^5.0.6",
"@types/node": "^25.0.3",
"@types/node": "^25.9.2",
"@types/webpack-env": "^1.18.8",
"express": "^5.2.1",
"rsbuild-plugin-rsc": "workspace:*",
"srvx": "^0.11.12"
"srvx": "^0.11.16"
}
}
12 changes: 8 additions & 4 deletions examples/react-router/src/entry.rsc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ import { generateHTML } from './entry.ssr';
import { routes } from './routes/config';
import { Layout } from './routes/root/route';

type NodeRequestHandler = (
req: IncomingMessage,
res: ServerResponse<IncomingMessage>,
) => void | Promise<void>;

async function fetchServer(request: Request) {
return matchRSCServerRequest({
// Provide the React Server touchpoints.
Expand Down Expand Up @@ -43,10 +48,9 @@ async function handler(request: Request): Promise<Response> {
});
}

const handleNodeRequest = toNodeHandler((request) => handler(request)) as (
req: IncomingMessage,
res: ServerResponse<IncomingMessage>,
) => void | Promise<void>;
const handleNodeRequest = toNodeHandler((request) =>
handler(request),
) as NodeRequestHandler;

function shouldBypassRequest(req: IncomingMessage) {
if (!req.url) {
Expand Down
12 changes: 6 additions & 6 deletions examples/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
"preview": "node server.js"
},
"dependencies": {
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"react-server-dom-rspack": "0.0.2",
"rsc-html-stream": "^0.0.7"
},
"devDependencies": {
"@rsbuild/core": "^2.0.6",
"@rsbuild/plugin-react": "^2.0.0",
"@rsbuild/core": "^2.0.12",
"@rsbuild/plugin-react": "^2.0.1",
"@types/express": "^5.0.6",
"@types/node": "^25.0.3",
"@types/node": "^25.9.2",
"@types/webpack-env": "^1.18.8",
"express": "^5.2.1",
"rsbuild-plugin-rsc": "workspace:*",
"srvx": "^0.9.8"
"srvx": "^0.11.16"
}
}
11 changes: 10 additions & 1 deletion examples/server/src/framework/entry.rsc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ import { toNodeHandler } from 'srvx/node';
import { renderHTML } from './entry.ssr.tsx';
import { parseRenderRequest } from './request.tsx';

type NodeRequestHandler = (
req: IncomingMessage,
res: ServerResponse<IncomingMessage>,
) => void | Promise<void>;

// The schema of payload which is serialized into RSC stream on rsc environment
// and deserialized on ssr/client environments.
export type RscPayload = {
Expand Down Expand Up @@ -166,7 +171,11 @@ const fetch = (
req: IncomingMessage,
res: ServerResponse<IncomingMessage>,
id?: number,
) => toNodeHandler((req) => handler(req, id))(req, res);
) =>
(toNodeHandler((request) => handler(request, id)) as NodeRequestHandler)(
req,
res,
);

async function nodeHandler(
req: IncomingMessage,
Expand Down
10 changes: 5 additions & 5 deletions examples/static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
"preview": "rsbuild preview"
},
"dependencies": {
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"react-server-dom-rspack": "0.0.2"
},
"devDependencies": {
"@rsbuild/core": "^2.0.6",
"@rsbuild/plugin-react": "^2.0.0",
"@rsbuild/core": "^2.0.12",
"@rsbuild/plugin-react": "^2.0.1",
"@types/react-dom": "^19.2.3",
"@types/webpack-env": "^1.18.8",
"cross-env": "^10.1.0",
"fast-glob": "^3.3.3",
"rsbuild-plugin-rsc": "workspace:*",
"rsc-html-stream": "^0.0.7",
"srvx": "^0.9.8"
"srvx": "^0.11.16"
}
}
8 changes: 6 additions & 2 deletions examples/static/src/framework/entry.rsc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import { parseRenderRequest } from './request';
import type { RscPayload } from './shared';
import type { Page, PageProps } from './ssg';

type NodeRequestHandler = (
req: IncomingMessage,
res: ServerResponse<IncomingMessage>,
) => void | Promise<void>;

function getPages(): Map<string, Page> {
const contextRequire = import.meta.webpackContext('../pages', {
recursive: false,
Expand Down Expand Up @@ -131,8 +136,7 @@ async function handler(request: Request): Promise<Response> {
});
}

const fetch = (req: IncomingMessage, res: ServerResponse<IncomingMessage>) =>
toNodeHandler(handler)(req, res);
const fetch = toNodeHandler(handler) as NodeRequestHandler;

async function nodeHandler(
req: IncomingMessage,
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rsbuild-plugin-rsc",
"version": "0.1.0",
"packageManager": "pnpm@11.1.2",
"packageManager": "pnpm@11.5.2",
"description": "React Server Components plugin for Rsbuild",
"repository": {
"type": "git",
Expand All @@ -28,17 +28,17 @@
},
"devDependencies": {
"@playwright/test": "^1.60.0",
"@rsbuild/core": "^2.0.6",
"@rslib/core": "^0.21.5",
"@rsbuild/core": "^2.0.12",
"@rslib/core": "^0.22.0",
"@rslint/core": "^0.5.3",
"@rstest/core": "^0.10.0",
"@rstest/core": "^0.10.3",
"@types/fs-extra": "^11.0.4",
"@types/node": "^25.8.0",
"@types/react": "^19.2.14",
"@types/node": "^25.9.2",
"@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3",
"fs-extra": "^11.3.5",
"playwright": "^1.60.0",
"prettier": "^3.8.3",
"prettier": "^3.8.4",
"react-server-dom-rspack": "0.0.2",
"typescript": "^6.0.3"
},
Expand Down
Loading
Loading