rsbuild-plugin-react-router 0.4.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/README.md +72 -240
  2. package/dist/{451.js → 511.js} +461 -331
  3. package/dist/build-output-transforms.d.ts +32 -7
  4. package/dist/classic-mode.d.ts +56 -0
  5. package/dist/config-imports.d.ts +8 -2
  6. package/dist/constants.d.ts +3 -0
  7. package/dist/dev-background-resources.d.ts +3 -3
  8. package/dist/dev-generation.d.ts +2 -3
  9. package/dist/dev-hmr.d.ts +8 -2
  10. package/dist/dev-runtime-controller.d.ts +6 -1
  11. package/dist/dev-source-maps.d.ts +4 -0
  12. package/dist/effect-runtime.d.ts +17 -5
  13. package/dist/entry-paths.d.ts +16 -0
  14. package/dist/environment-output.d.ts +6 -0
  15. package/dist/export-utils.d.ts +2 -1
  16. package/dist/federation.d.ts +2 -0
  17. package/dist/index.cjs +3675 -2107
  18. package/dist/index.d.ts +3 -1
  19. package/dist/index.js +3614 -2214
  20. package/dist/lazy-compilation-prewarm.d.ts +8 -5
  21. package/dist/manifest.d.ts +16 -4
  22. package/dist/mode-plan.d.ts +82 -0
  23. package/dist/modify-browser-manifest.d.ts +8 -4
  24. package/dist/performance.d.ts +4 -1
  25. package/dist/plugin-utils.d.ts +27 -1
  26. package/dist/prerender-build.d.ts +5 -5
  27. package/dist/prerender.d.ts +1 -5
  28. package/dist/react-router-config.d.ts +11 -3
  29. package/dist/route-artifacts.d.ts +4 -2
  30. package/dist/route-chunks.d.ts +2 -1
  31. package/dist/route-component-transform.d.ts +0 -2
  32. package/dist/route-export-pruning.d.ts +4 -1
  33. package/dist/route-imports.d.ts +18 -0
  34. package/dist/route-module-transform-loader.d.ts +14 -0
  35. package/dist/route-module-transform-loader.js +44 -0
  36. package/dist/route-module-transform-rules.d.ts +14 -0
  37. package/dist/route-transform-tasks.d.ts +6 -0
  38. package/dist/route-watch.d.ts +11 -6
  39. package/dist/rsc-dev-server.d.ts +26 -0
  40. package/dist/rsc-prerender.d.ts +54 -0
  41. package/dist/rsc-route-config.d.ts +6 -0
  42. package/dist/rsc-route-exports.d.ts +15 -0
  43. package/dist/rsc-route-transform-loader.cjs +43 -0
  44. package/dist/rsc-route-transform-loader.d.ts +30 -0
  45. package/dist/rsc-route-transform-loader.js +16 -0
  46. package/dist/rsc-route-transform-registration.d.ts +12 -0
  47. package/dist/rsc-route-transforms.d.ts +21 -0
  48. package/dist/rsc-support.d.ts +23 -0
  49. package/dist/rsc-virtual-modules.d.ts +19 -0
  50. package/dist/server-build-plan.d.ts +2 -1
  51. package/dist/server-build-resolution.d.ts +1 -2
  52. package/dist/server-utils.d.ts +4 -5
  53. package/dist/ssr-asset-relocation.d.ts +98 -0
  54. package/dist/templates/entry.rsc.client.d.ts +1 -0
  55. package/dist/templates/entry.rsc.client.js +61 -0
  56. package/dist/templates/entry.rsc.d.ts +9 -0
  57. package/dist/templates/entry.rsc.js +38 -0
  58. package/dist/templates/entry.rsc.ssr.d.ts +4 -0
  59. package/dist/templates/entry.rsc.ssr.js +24 -0
  60. package/dist/typegen.d.ts +4 -2
  61. package/dist/types.d.ts +34 -6
  62. package/package.json +76 -22
  63. package/src/build-output-transforms.ts +181 -43
  64. package/src/classic-mode.ts +253 -0
  65. package/src/config-imports.ts +153 -6
  66. package/src/constants.ts +6 -2
  67. package/src/dev-background-resources.ts +46 -100
  68. package/src/dev-generation.ts +52 -33
  69. package/src/dev-hmr.ts +112 -80
  70. package/src/dev-runtime-artifacts.ts +11 -12
  71. package/src/dev-runtime-controller.ts +75 -85
  72. package/src/dev-runtime-session.ts +14 -18
  73. package/src/dev-server.ts +2 -0
  74. package/src/dev-source-maps.ts +257 -0
  75. package/src/effect-runtime.ts +105 -57
  76. package/src/entry-paths.ts +80 -0
  77. package/src/environment-output.ts +55 -0
  78. package/src/export-utils.ts +15 -11
  79. package/src/federation.ts +38 -0
  80. package/src/index.ts +666 -519
  81. package/src/lazy-compilation-prewarm.ts +20 -4
  82. package/src/manifest.ts +157 -82
  83. package/src/mode-plan.ts +367 -0
  84. package/src/modify-browser-manifest.ts +130 -124
  85. package/src/performance.ts +11 -2
  86. package/src/plugin-utils.ts +103 -39
  87. package/src/prerender-build.ts +82 -104
  88. package/src/prerender.ts +23 -24
  89. package/src/react-router-config.ts +72 -26
  90. package/src/route-artifacts.ts +96 -66
  91. package/src/route-chunks.ts +167 -51
  92. package/src/route-component-transform.ts +14 -21
  93. package/src/route-export-pruning.ts +4 -3
  94. package/src/route-imports.ts +100 -0
  95. package/src/route-module-transform-loader.ts +149 -0
  96. package/src/route-module-transform-rules.ts +115 -0
  97. package/src/route-transform-tasks.ts +44 -29
  98. package/src/route-watch.ts +166 -188
  99. package/src/rsc-dev-server.ts +112 -0
  100. package/src/rsc-prerender.ts +362 -0
  101. package/src/rsc-route-config.ts +175 -0
  102. package/src/rsc-route-exports.ts +67 -0
  103. package/src/rsc-route-transform-loader.ts +65 -0
  104. package/src/rsc-route-transform-registration.ts +145 -0
  105. package/src/rsc-route-transforms.ts +995 -0
  106. package/src/rsc-runtime.d.ts +143 -0
  107. package/src/rsc-support.ts +116 -0
  108. package/src/rsc-virtual-modules.ts +113 -0
  109. package/src/server-build-plan.ts +14 -3
  110. package/src/server-build-resolution.ts +37 -47
  111. package/src/server-utils.ts +21 -35
  112. package/src/ssr-asset-relocation.ts +183 -0
  113. package/src/ssr-externals.ts +8 -26
  114. package/src/templates/entry.rsc.client.tsx +168 -0
  115. package/src/templates/entry.rsc.ssr.tsx +45 -0
  116. package/src/templates/entry.rsc.tsx +80 -0
  117. package/src/typegen.ts +40 -23
  118. package/src/types.ts +43 -6
  119. package/src/warnings/warn-on-client-source-maps.ts +6 -10
  120. package/dist/parallel-route-transform-protocol.d.ts +0 -25
  121. package/dist/parallel-route-transform-worker.d.ts +0 -1
  122. package/dist/parallel-route-transform-worker.js +0 -38
  123. package/dist/parallel-route-transforms.d.ts +0 -29
  124. package/src/parallel-route-transform-protocol.ts +0 -35
  125. package/src/parallel-route-transform-worker.ts +0 -82
  126. package/src/parallel-route-transforms.ts +0 -458
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  <a href="https://rsbuild.dev" target="blank"><img src="https://github.com/web-infra-dev/rsbuild/assets/7237365/84abc13e-b620-468f-a90b-dbf28e7e9427" alt="Rsbuild Logo" /></a>
5
5
  </p>
6
6
 
7
- A Rsbuild plugin that provides seamless integration with React Router, supporting both client-side routing and server-side rendering (SSR).
7
+ React Router Framework Mode for Rsbuild.
8
8
 
9
9
  ## Features
10
10
 
@@ -19,6 +19,21 @@ A Rsbuild plugin that provides seamless integration with React Router, supportin
19
19
  - ☁️ Cloudflare Workers deployment support
20
20
  - 🔗 Module Federation support (experimental)
21
21
 
22
+ ## Framework Mode
23
+
24
+ The plugin lets an Rsbuild application use the standard React Router Framework
25
+ Mode conventions:
26
+
27
+ - `react-router.config.*` for application configuration
28
+ - `app/routes.ts` and `@react-router/dev/routes` for route configuration
29
+ - Route Module exports such as `loader`, `action`, `meta`, `links`, and
30
+ `shouldRevalidate`
31
+ - generated `./+types/*` types
32
+ - standard `entry.client` and `entry.server` entrypoints
33
+
34
+ Some React Router build-tool integrations are not supported 1:1. See the
35
+ configuration and examples below for the currently supported behavior.
36
+
22
37
  ## Installation
23
38
 
24
39
  ```bash
@@ -29,18 +44,6 @@ yarn add rsbuild-plugin-react-router
29
44
  pnpm add rsbuild-plugin-react-router
30
45
  ```
31
46
 
32
- ## Local development
33
-
34
- For the federation examples and Playwright e2e tests, use Node 22 and the
35
- repo-pinned pnpm version:
36
-
37
- ```bash
38
- nvm install
39
- nvm use
40
- corepack enable
41
- corepack prepare pnpm@9.15.3 --activate
42
- ```
43
-
44
47
  ## Usage
45
48
 
46
49
  Add the plugin to your `rsbuild.config.ts`:
@@ -60,6 +63,17 @@ export default defineConfig({
60
63
  });
61
64
  ```
62
65
 
66
+ Continue using the standard React Router Framework Mode project structure:
67
+
68
+ ```text
69
+ app/
70
+ root.tsx
71
+ routes.ts
72
+ routes/
73
+ react-router.config.ts
74
+ rsbuild.config.ts
75
+ ```
76
+
63
77
  ## Configuration
64
78
 
65
79
  React Router application settings live in `react-router.config.*`. The Rsbuild
@@ -77,16 +91,16 @@ pluginReactRouter({
77
91
  });
78
92
  ```
79
93
 
80
- | Option | Default | Description |
81
- | -------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
82
- | `customServer` | `false` | Disables the built-in development SSR middleware. Enable this when an app owns the server with `createDevServer()` or an adapter. |
83
- | `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. |
84
- | `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. |
85
- | `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. |
86
- | `logPerformance` | `false` | Logs structured React Router plugin timing information through the Rsbuild logger. |
87
- | `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. |
88
- | `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. |
89
- | `federation` | `false` | Enables the plugin's experimental Module Federation integration. |
94
+ | Option | Default | Description |
95
+ | -------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
96
+ | `customServer` | `false` | Disables the built-in development SSR middleware. Enable this when an app owns the server with `createDevServer()` or an adapter. |
97
+ | `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. |
98
+ | `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. |
99
+ | `unstableLazyCompilationPrewarm` | `false` | Experimental prewarm for emitted lazy-compilation proxy modules after dev compiles. Enable with `true` when route JS proxy startup should happen shortly after compiler readiness. |
100
+ | `logPerformance` | `false` | Logs structured React Router plugin timing information. |
101
+ | `parallelRouteTransform` | `undefined` | Controls worker-thread route transforms. `undefined` and `false` keep transforms inline, `true` uses an automatic worker count, and a positive integer sets the maximum worker count. |
102
+ | `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. |
103
+ | `federation` | `false` | Enables the plugin's experimental Module Federation integration. |
90
104
 
91
105
  When `federation` is enabled, configure the Module Federation plugin with
92
106
  `experiments.asyncStartup: true`. The dev server resolves async server build
@@ -111,10 +125,11 @@ export default {
111
125
  ```
112
126
 
113
127
  Use `ReactRouterRsbuildConfig` for Rsbuild projects so plugin-supported
114
- configuration such as `splitRouteModules` stays typed. The underlying route
115
- and config types come from `@react-router/dev`, which framework-mode apps
116
- already install for `routes.ts` helpers and typegen; it is declared as an
117
- optional peer dependency.
128
+ configuration such as `splitRouteModules` stays typed across React Router 7
129
+ and 8 releases. The underlying route and config types come from
130
+ `@react-router/dev`, which framework-mode apps already install for
131
+ `routes.ts` helpers and typegen; it is declared as an optional peer
132
+ dependency.
118
133
 
119
134
  Commonly used options:
120
135
 
@@ -146,29 +161,18 @@ The plugin will look for `react-router.config` with any supported JS/TS extensio
146
161
 
147
162
  If none are found, it falls back to defaults.
148
163
 
149
- ### Framework Mode
150
-
151
- React Router "Framework Mode" is implemented as a Vite plugin, but this Rsbuild
152
- plugin aims to provide equivalent **framework-mode behaviors** (typegen, Route
153
- Module API types, route module splitting, SPA/SSR/prerender strategies) on top
154
- of Rsbuild/Rspack.
155
-
156
- In practice, you should be able to use the `@react-router/dev/*` config + routes
157
- APIs, import generated `./+types/*` in route modules, and use the standard
158
- `entry.client`/`entry.server` entrypoints like you would in the official setup.
159
-
160
164
  ### FAQ
161
165
 
162
166
  #### rsbuild-plugin-react-router vs ModernJS
163
167
 
164
- This plugin is a lightweight adapter to run React Router on Rsbuild. It does
165
- not aim to replace ModernJS or its higher-level framework features. If your
166
- goal is a full framework or advanced microfrontend support, ModernJS may be
167
- a better fit.
168
+ This plugin is a focused React Router Framework Mode adapter for Rsbuild. It
169
+ does not aim to replace ModernJS or its higher-level framework features. If
170
+ your goal is a broader application framework or advanced microfrontend
171
+ support, ModernJS may be a better fit.
168
172
 
169
173
  ### SPA Mode (`ssr: false`)
170
174
 
171
- React Router's SPA Mode still requires a build-time server render of the root route to generate a hydratable `index.html` (this is how the official React Router Vite plugin works).
175
+ React Router's SPA Mode still requires a build-time server render of the root route to generate a hydratable `index.html` (this is how this Rsbuild integration mirrors React Router framework behavior).
172
176
 
173
177
  When `ssr: false`:
174
178
 
@@ -242,10 +246,10 @@ Rsbuild source maps for faster local debugging, prefer a cheap JS map:
242
246
 
243
247
  Lazy compilation prewarming is disabled by default. When enabled alongside
244
248
  `lazyCompilation`, the plugin fetches emitted browser entry and route JS assets,
245
- extracts activation keys from Rspack's generated lazy-compilation client calls,
246
- and POSTs those keys to Rspack's configured lazy trigger endpoint after dev
247
- compiles. It does not request application routes or run route loaders. Because
248
- the key extraction depends on Rspack's generated client code shape, opt in with
249
+ extracts activation keys from the generated lazy-compilation client calls, and
250
+ POSTs those keys to the configured lazy trigger endpoint after dev compiles. It
251
+ does not request application routes or run route loaders. Because the key
252
+ extraction depends on the generated client code shape, opt in with
249
253
  `unstableLazyCompilationPrewarm: true`.
250
254
 
251
255
  Subresource Integrity is disabled by default. Enable it with
@@ -486,163 +490,10 @@ Then update your `package.json` scripts:
486
490
 
487
491
  ## Cloudflare Workers Deployment
488
492
 
489
- To deploy your React Router app to Cloudflare Workers:
490
-
491
- 1. **Configure Rsbuild** (`rsbuild.config.ts`):
492
-
493
- ```ts
494
- import { defineConfig } from '@rsbuild/core';
495
- import { pluginReact } from '@rsbuild/plugin-react';
496
- import { pluginReactRouter } from 'rsbuild-plugin-react-router';
497
-
498
- export default defineConfig({
499
- environments: {
500
- node: {
501
- performance: {
502
- chunkSplit: { strategy: 'all-in-one' },
503
- },
504
- tools: {
505
- rspack: {
506
- experiments: { outputModule: true },
507
- externalsType: 'module',
508
- output: {
509
- chunkFormat: 'module',
510
- chunkLoading: 'import',
511
- workerChunkLoading: 'import',
512
- wasmLoading: 'fetch',
513
- library: { type: 'module' },
514
- module: true,
515
- },
516
- resolve: {
517
- conditionNames: [
518
- 'workerd',
519
- 'worker',
520
- 'browser',
521
- 'import',
522
- 'require',
523
- ],
524
- },
525
- },
526
- },
527
- },
528
- },
529
- plugins: [pluginReactRouter({ customServer: true }), pluginReact()],
530
- });
531
- ```
532
-
533
- 2. **Configure Wrangler** (`wrangler.toml`):
534
-
535
- ```toml
536
- workers_dev = true
537
- name = "my-react-router-worker"
538
- compatibility_date = "2024-11-18"
539
- main = "./build/server/static/js/app.js"
540
- assets = { directory = "./build/client/" }
541
-
542
- [vars]
543
- VALUE_FROM_CLOUDFLARE = "Hello from Cloudflare"
544
-
545
- # Optional build configuration
546
- # [build]
547
- # command = "npm run build"
548
- # watch_dir = "app"
549
- ```
550
-
551
- 3. **Create Worker Entry** (`server/index.ts`):
552
-
553
- ```ts
554
- import { createRequestHandler } from 'react-router';
555
-
556
- declare global {
557
- interface CloudflareEnvironment extends Env {}
558
- interface ImportMeta {
559
- env: {
560
- MODE: string;
561
- };
562
- }
563
- }
564
-
565
- declare module 'react-router' {
566
- export interface AppLoadContext {
567
- cloudflare: {
568
- env: CloudflareEnvironment;
569
- ctx: ExecutionContext;
570
- };
571
- }
572
- }
573
-
574
- // @ts-expect-error - virtual module provided by React Router at build time
575
- import * as serverBuild from 'virtual/react-router/server-build';
576
-
577
- const requestHandler = createRequestHandler(serverBuild, import.meta.env.MODE);
578
-
579
- export default {
580
- fetch(request, env, ctx) {
581
- return requestHandler(request, {
582
- cloudflare: { env, ctx },
583
- });
584
- },
585
- } satisfies ExportedHandler<CloudflareEnvironment>;
586
- ```
587
-
588
- 4. **Update Package Dependencies**:
589
-
590
- ```json
591
- {
592
- "dependencies": {
593
- "@react-router/node": "^7.13.0",
594
- "@react-router/serve": "^7.13.0",
595
- "react-router": "^7.13.0"
596
- },
597
- "devDependencies": {
598
- "@cloudflare/workers-types": "^4.20241112.0",
599
- "@react-router/cloudflare": "^7.13.0",
600
- "@react-router/dev": "^7.13.0",
601
- "wrangler": "^3.106.0"
602
- }
603
- }
604
- ```
605
-
606
- 5. **Setup Deployment Scripts** (`package.json`):
607
-
608
- ```json
609
- {
610
- "scripts": {
611
- "build": "rsbuild build",
612
- "deploy": "npm run build && wrangler deploy",
613
- "dev": "rsbuild dev",
614
- "start": "wrangler dev"
615
- }
616
- }
617
- ```
618
-
619
- ### Key Configuration Notes:
620
-
621
- - The `workers_dev = true` setting enables deployment to workers.dev subdomain
622
- - `main` points to your Worker's entry point in the build output
623
- - `assets` directory specifies where your static client files are located
624
- - Environment variables can be set in the `[vars]` section
625
- - The `compatibility_date` should be kept up to date
626
- - TypeScript types are provided via `@cloudflare/workers-types`
627
- - Development can be done locally using `wrangler dev`
628
- - Deployment is handled through `wrangler deploy`
629
-
630
- ### Development Workflow:
631
-
632
- 1. Local Development:
633
-
634
- ```bash
635
- # Start local development server
636
- npm run dev
637
- # or
638
- npm start
639
- ```
640
-
641
- 2. Production Deployment:
642
- ```bash
643
- # Build and deploy
644
- npm run deploy
645
- ```
493
+ Start from the tested [Cloudflare example](./examples/cloudflare). It contains
494
+ the complete Rsbuild configuration, Worker entry, Wrangler configuration, and
495
+ deployment scripts. The example uses `customServer: true` so the Worker owns
496
+ the React Router request handler.
646
497
 
647
498
  ## Development
648
499
 
@@ -653,49 +504,28 @@ The plugin automatically:
653
504
  - Handles route-based code splitting
654
505
  - Manages client and server builds
655
506
 
656
- ### Benchmarking
657
-
658
- `pnpm bench:large` runs this repository's generated stress fixture for quick
659
- regression checks. `pnpm bench:synthetic-app` runs the embedded complex Rsbuild
660
- app under `benchmarks/synthetic-web-bundler-benchmark`, which adds heavier
661
- loader and transform contention for benchmark coverage closer to a large
662
- real-world application.
507
+ For local development, use Node 22 and the repository's pinned pnpm version:
663
508
 
664
509
  ```bash
665
- pnpm bench:large
666
- pnpm bench:synthetic-app -- --profile all --runs 2
510
+ nvm install
511
+ nvm use
512
+ corepack enable
513
+ corepack prepare pnpm@9.15.3 --activate
667
514
  ```
668
515
 
669
- The PR benchmark workflow reports production build, dev route-load, HMR/update,
670
- and embedded synthetic app timings in the same benchmark comment. It measures
671
- the PR and its base on the same runner instead of reusing cached timing data,
672
- counterbalances which side runs first, and excludes one warmup iteration. Small
673
- fixtures use five measured iterations; expensive large fixtures use three.
674
-
675
- Every raw median delta remains visible. The comment also reports each side's
676
- relative median absolute deviation (rMAD), a conservative noise band, and a
677
- signal label:
678
-
679
- - `regression` or `improvement` means the median delta exceeds the observed
680
- run-to-run noise band.
681
- - `inconclusive` means the raw delta is not clearly separated from that noise.
682
- - `insufficient data` means either side has fewer than three finite samples.
683
-
684
- The labels are triage aids, not pass/fail gates. Use the uploaded diagnostics
685
- and raw per-run samples to investigate important changes, and rerun an
686
- inconclusive comparison before treating it as a performance result.
687
-
688
- ## React Router Framework Mode
516
+ ### Benchmarking
689
517
 
690
- React Router "Framework Mode" wraps Data Mode using a Vite plugin. This Rsbuild
691
- plugin aims to match the important behaviors without depending on Vite:
518
+ Run the focused local suite for plugin regression checks:
692
519
 
693
- - Typegen + Route Module API types (`./+types/*`)
694
- - Route module splitting (`splitRouteModules`)
695
- - SPA mode (`ssr: false`), SSR mode, and static prerendering (`prerender`)
520
+ ```bash
521
+ pnpm bench
522
+ pnpm bench:smoke
523
+ pnpm bench:codspeed
524
+ ```
696
525
 
697
- Some Vite-specific integrations (for example Vite's environment API + critical
698
- CSS endpoint) are not supported 1:1.
526
+ See the [benchmark guide](./benchmarks/README.md) for JSON output, pull-request
527
+ comparisons and comments, `BENCHMARK_PLUGIN_ROOT`, and optional CodSpeed
528
+ publication.
699
529
 
700
530
  ## Examples
701
531
 
@@ -709,6 +539,8 @@ The repository includes several examples demonstrating different use cases:
709
539
  | [custom-node-server](./examples/custom-node-server) | Custom Express server with SSR | 3003 | `pnpm dev` |
710
540
  | [cloudflare](./examples/cloudflare) | Cloudflare Workers deployment | 3004 | `pnpm dev` |
711
541
  | [client-only](./examples/client-only) | `.client` modules with SSR hydration | 3010 | `pnpm dev` |
542
+ | [react-router-8](./examples/react-router-8) | React Router 8 framework-mode SSR | 3020 | `pnpm dev` |
543
+ | [rsc-mode](./examples/rsc-mode) | Experimental RSC Framework Mode | 3021 | `pnpm dev` |
712
544
  | [epic-stack](./examples/epic-stack) | Full-featured Epic Stack example | 3005 | `pnpm dev` |
713
545
  | [federation/epic-stack](./examples/federation/epic-stack) | Module Federation host | 3006 | `pnpm dev` |
714
546
  | [federation/epic-stack-remote](./examples/federation/epic-stack-remote) | Module Federation remote | 3007 | `pnpm dev` |