Skip to content
Open
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
5 changes: 5 additions & 0 deletions .changeset/calm-routes-transform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'rsbuild-plugin-react-router': minor
---

Keep route transforms inline by default and expose Rspack parallel loader workers as an explicit opt-in.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document that parallel transforms are development-only.

Production currently uses the inline API-transform path, so parallelRouteTransform has no production effect. Please clarify this in the changeset, or add production support before describing the option without that limitation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.changeset/calm-routes-transform.md at line 5, Update the changeset text to
clarify that parallel route transforms are development-only and that production
continues using the inline API-transform path; do not describe
parallelRouteTransform as affecting production unless production support is
added.

20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ pluginReactRouter({
});
```

| Option | Default | Description |
| -------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `customServer` | `false` | Disables the built-in development SSR middleware. Enable this when an app owns the server with `createDevServer()` or an adapter. |
| `serverOutput` | Derived | Emitted Rsbuild server format: `'module'` or `'commonjs'`. When omitted, React Router's `serverModuleFormat` selects the format (`'esm'` -> `'module'`, `'cjs'` -> `'commonjs'`); setting `serverOutput` overrides it. |
| `lazyCompilation` | `true` | Optional Rsbuild dev lazy-compilation config. When enabled here or through `dev.lazyCompilation`, React Router hydration-critical modules stay eager so the browser manifest and route modules are not replaced by lazy proxies. |
| `unstableLazyCompilationPrewarm` | `false` | Experimental prewarm for emitted Rspack lazy-compilation proxy modules after dev compiles. Enable with `true` when route JS proxy startup should happen shortly after compiler readiness. |
| `logPerformance` | `false` | Logs structured React Router plugin timing information through the Rsbuild logger. |
| `parallelRouteTransform` | `undefined` | Controls worker-thread route transforms. `undefined` auto-enables workers for 256+ routes, `true` forces the default worker count (in dev this is 0 on machines with 4 or fewer cores, where workers cost more than they save; production builds always use workers), a positive integer sets the worker count, and `false` keeps transforms inline. |
| `onRouteTopologyChange` | `undefined` | Notification for programmatic/custom dev servers. Recreate the Rsbuild server when route files are added, removed, or moved. The callback is not awaited. |
| `federation` | `false` | Enables the plugin's experimental Module Federation integration. |
| Option | Default | Description |
| -------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `customServer` | `false` | Disables the built-in development SSR middleware. Enable this when an app owns the server with `createDevServer()` or an adapter. |
| `serverOutput` | Derived | Emitted Rsbuild server format: `'module'` or `'commonjs'`. When omitted, React Router's `serverModuleFormat` selects the format (`'esm'` -> `'module'`, `'cjs'` -> `'commonjs'`); setting `serverOutput` overrides it. |
| `lazyCompilation` | `true` | Optional Rsbuild dev lazy-compilation config. When enabled here or through `dev.lazyCompilation`, React Router hydration-critical modules stay eager so the browser manifest and route modules are not replaced by lazy proxies. |
| `unstableLazyCompilationPrewarm` | `false` | Experimental prewarm for emitted Rspack lazy-compilation proxy modules after dev compiles. Enable with `true` when route JS proxy startup should happen shortly after compiler readiness. |
| `logPerformance` | `false` | Logs structured React Router plugin timing information. |
| `parallelRouteTransform` | `undefined` | Controls worker-thread route transforms. `undefined` and `false` keep transforms inline, `true` uses Rspack's default worker count, and a positive integer sets the maximum worker count. |
| `onRouteTopologyChange` | `undefined` | Notification for programmatic/custom dev servers. Recreate the Rsbuild server when route files are added, removed, or moved. The callback is not awaited. |
| `federation` | `false` | Enables the plugin's experimental Module Federation integration. |

When `federation` is enabled, configure the Module Federation plugin with
`experiments.asyncStartup: true`. The dev server resolves async server build
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/synthetic-web-bundler-benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"devDependencies": {
"@babel/core": "7.29.0",
"@react-router/dev": "7.14.0",
"@rsbuild/core": "2.1.0",
"@rsbuild/core": "2.1.5",
"@rsbuild/plugin-babel": "2.0.0",
"@rsbuild/plugin-react": "2.1.0",
"@rsbuild/plugin-svgr": "2.0.4",
Expand Down
4 changes: 2 additions & 2 deletions config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "1.0.1",
"private": true,
"devDependencies": {
"@rsbuild/core": "2.1.0",
"@rslib/core": "0.22.1",
"@rsbuild/core": "2.1.5",
"@rslib/core": "0.23.2",
"@types/node": "^25.0.10",
"typescript": "^5.9.3"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/client-only/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"devDependencies": {
"@playwright/test": "^1.61.1",
"@react-router/dev": "^7.13.0",
"@rsbuild/core": "2.1.0",
"@rsbuild/core": "2.1.5",
"@rsbuild/plugin-react": "^2.1.0",
"@types/node": "^25.0.10",
"@types/react": "^19.2.10",
Expand Down
2 changes: 1 addition & 1 deletion examples/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@playwright/test": "^1.61.1",
"@react-router/cloudflare": "^7.13.0",
"@react-router/dev": "^7.13.0",
"@rsbuild/core": "2.1.0",
"@rsbuild/core": "2.1.5",
"@rsbuild/plugin-react": "^2.1.0",
"@tailwindcss/postcss": "^4.1.18",
"@types/node": "^25.0.10",
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-node-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"devDependencies": {
"@playwright/test": "^1.61.1",
"@react-router/dev": "^7.13.0",
"@rsbuild/core": "2.1.0",
"@rsbuild/core": "2.1.5",
"@rsbuild/plugin-react": "^2.1.0",
"@rsdoctor/rspack-plugin": "^1.5.13",
"@tailwindcss/postcss": "^4.1.18",
Expand Down
2 changes: 1 addition & 1 deletion examples/default-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"devDependencies": {
"@playwright/test": "^1.61.1",
"@react-router/dev": "^7.13.0",
"@rsbuild/core": "2.1.0",
"@rsbuild/core": "2.1.5",
"@rsbuild/plugin-less": "^1.6.4",
"@rsbuild/plugin-react": "^2.1.0",
"@rsbuild/plugin-sass": "^1.5.3",
Expand Down
6 changes: 3 additions & 3 deletions examples/epic-stack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@react-router/node": "^7.13.0",
"@react-router/remix-routes-option-adapter": "7.13.0",
"@remix-run/server-runtime": "2.17.4",
"@rsbuild/core": "2.1.0",
"@rsbuild/core": "2.1.5",
"@rsbuild/plugin-react": "2.1.0",
"@sentry/node": "10.37.0",
"@sentry/profiling-node": "10.37.0",
Expand Down Expand Up @@ -121,6 +121,8 @@
"@faker-js/faker": "10.2.0",
"@playwright/test": "^1.61.1",
"@react-router/dev": "^7.13.0",
"@rstest/core": "0.11.0",
"@rstest/coverage-istanbul": "0.11.0",
"@sentry/vite-plugin": "4.8.0",
"@sly-cli/sly": "2.1.1",
"@tailwindcss/nesting": "0.0.0-insiders.565cd3e",
Expand All @@ -144,8 +146,6 @@
"@types/react-dom": "19.2.3",
"@types/set-cookie-parser": "2.4.10",
"@types/source-map-support": "0.5.10",
"@rstest/core": "0.8.1",
"@rstest/coverage-istanbul": "0.2.0",
"@vitejs/plugin-react": "5.1.2",
"autoprefixer": "10.4.23",
"enforce-unique": "1.3.0",
Expand Down
8 changes: 4 additions & 4 deletions examples/federation/epic-stack-remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"@epic-web/invariant": "1.0.0",
"@epic-web/remember": "1.1.0",
"@epic-web/totp": "4.0.1",
"@mjackson/headers": "0.6.1",
"@mjackson/form-data-parser": "0.9.1",
"@mjackson/headers": "0.6.1",
"@module-federation/enhanced": "2.5.1",
"@module-federation/node": "2.7.44",
"@module-federation/rsbuild-plugin": "2.5.1",
Expand All @@ -70,7 +70,7 @@
"@react-router/node": "^7.13.0",
"@react-router/remix-routes-option-adapter": "7.13.0",
"@remix-run/server-runtime": "2.17.4",
"@rsbuild/core": "2.1.0",
"@rsbuild/core": "2.1.5",
"@rsbuild/plugin-react": "2.1.0",
"@sentry/node": "10.37.0",
"@sentry/profiling-node": "10.37.0",
Expand Down Expand Up @@ -124,6 +124,8 @@
"@faker-js/faker": "10.2.0",
"@playwright/test": "^1.61.1",
"@react-router/dev": "^7.13.0",
"@rstest/core": "0.11.0",
"@rstest/coverage-istanbul": "0.11.0",
"@sly-cli/sly": "2.1.1",
"@tailwindcss/nesting": "0.0.0-insiders.565cd3e",
"@tailwindcss/postcss": "^4.1.18",
Expand All @@ -146,8 +148,6 @@
"@types/react-dom": "19.2.3",
"@types/set-cookie-parser": "2.4.10",
"@types/source-map-support": "0.5.10",
"@rstest/core": "0.8.1",
"@rstest/coverage-istanbul": "0.2.0",
"autoprefixer": "10.4.23",
"enforce-unique": "1.3.0",
"esbuild": "0.27.2",
Expand Down
8 changes: 4 additions & 4 deletions examples/federation/epic-stack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"@epic-web/invariant": "1.0.0",
"@epic-web/remember": "1.1.0",
"@epic-web/totp": "4.0.1",
"@mjackson/headers": "0.6.1",
"@mjackson/form-data-parser": "0.9.1",
"@mjackson/headers": "0.6.1",
"@module-federation/enhanced": "2.5.1",
"@module-federation/node": "2.7.44",
"@module-federation/rsbuild-plugin": "2.5.1",
Expand All @@ -70,7 +70,7 @@
"@react-router/node": "^7.13.0",
"@react-router/remix-routes-option-adapter": "7.13.0",
"@remix-run/server-runtime": "2.17.4",
"@rsbuild/core": "2.1.0",
"@rsbuild/core": "2.1.5",
"@rsbuild/plugin-react": "2.1.0",
"@sentry/node": "10.37.0",
"@sentry/profiling-node": "10.37.0",
Expand Down Expand Up @@ -124,6 +124,8 @@
"@faker-js/faker": "10.2.0",
"@playwright/test": "^1.61.1",
"@react-router/dev": "^7.13.0",
"@rstest/core": "0.11.0",
"@rstest/coverage-istanbul": "0.11.0",
"@sly-cli/sly": "2.1.1",
"@tailwindcss/nesting": "0.0.0-insiders.565cd3e",
"@tailwindcss/postcss": "^4.1.18",
Expand All @@ -146,8 +148,6 @@
"@types/react-dom": "19.2.3",
"@types/set-cookie-parser": "2.4.10",
"@types/source-map-support": "0.5.10",
"@rstest/core": "0.8.1",
"@rstest/coverage-istanbul": "0.2.0",
"autoprefixer": "10.4.23",
"enforce-unique": "1.3.0",
"esbuild": "0.27.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/prerender/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"devDependencies": {
"@playwright/test": "^1.61.1",
"@react-router/dev": "^7.13.0",
"@rsbuild/core": "2.1.0",
"@rsbuild/core": "2.1.5",
"@rsbuild/plugin-react": "^2.1.0",
"@tailwindcss/postcss": "^4.1.18",
"@types/node": "^25.0.10",
Expand Down
2 changes: 1 addition & 1 deletion examples/spa-mode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"devDependencies": {
"@playwright/test": "^1.61.1",
"@react-router/dev": "^7.13.0",
"@rsbuild/core": "2.1.0",
"@rsbuild/core": "2.1.5",
"@rsbuild/plugin-react": "^2.1.0",
"@tailwindcss/postcss": "^4.1.18",
"@types/node": "^25.0.10",
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"release:local": "pnpm build && changeset version && changeset publish && git add . && git commit -m \"chore: version packages\" && git push && git push --tags"
},
"dependencies": {
"@jridgewell/remapping": "^2.3.5",
"@react-router/node": "^7.13.0",
"@remix-run/node-fetch-server": "^0.13.0",
"@rspack/plugin-react-refresh": "^2.0.2",
Expand All @@ -90,14 +91,15 @@
},
"devDependencies": {
"@changesets/cli": "^2.29.8",
"@jridgewell/trace-mapping": "^0.3.31",
"@react-router/dev": "^8.0.1",
"@rsbuild/config": "workspace:*",
"@rsbuild/core": "2.1.0",
"@rsbuild/core": "2.1.5",
"@rsbuild/plugin-react": "2.1.0",
"@rslib/core": "^0.22.1",
"@rspack/core": "2.1.0",
"@rstest/core": "^0.8.1",
"@rstest/coverage-istanbul": "^0.2.0",
"@rslib/core": "^0.23.2",
"@rspack/core": "2.1.3",
"@rstest/core": "^0.11.0",
"@rstest/coverage-istanbul": "^0.11.0",
"@swc/helpers": "^0.5.23",
"@types/fs-extra": "11.0.4",
"@types/jsesc": "^3.0.3",
Expand Down
Loading
Loading