@@ -48,15 +48,17 @@ export default defineConfig({
4848```
4949
5050Defaults are ` remoteEntry.js ` , ` manifest: true ` , and
51- ` hostInitInjectLocation: "entry" ` . React and ` react-dom ` are shared singleton
52- defaults; any explicit entries in ` shared ` take precedence.
51+ ` hostInitInjectLocation: "entry" ` . React and ` react-dom ` are shared
52+ singletons; when the config declares ` remotes ` , they are also eager so the
53+ host's own React stays in the share scope. Explicit entries in ` shared ` take
54+ precedence.
5355
5456Do not set a global Module Federation ` target ` . TanStack Start builds client
5557and SSR environments from one Vite configuration, so the wrapper leaves target
5658selection to ` @module-federation/vite ` for each environment.
5759
5860The package supports Node 22.18+, 24.11+, and 26+, plus Vite 7/8 and TanStack
59- Start 1.x . Use Vite 8 when developing SSR hosts that load remotes; Vite 7
61+ Start 1.167.43+ . Use Vite 8 when developing SSR hosts that load remotes; Vite 7
6062remains supported for production builds.
6163
6264The package root remains a Vite compatibility export. New Vite projects can
@@ -75,35 +77,47 @@ export default defineConfig({
7577 ... tanstackStartModuleFederation ({
7678 federation: {
7779 name: " host" ,
80+ shareStrategy: " loaded-first" ,
7881 remotes: { remote: " remote@https://example.test/mf-manifest.json" },
7982 },
8083 }),
8184 ],
8285});
8386```
8487
85- The Rsbuild adapter registers browser and SSR federation plugins by default. It
86- emits script-compatible browser output and async-node CommonJS SSR output so
87- its manifest can be consumed by Vite and Rsbuild hosts. The wrapper adds eager,
88- singleton ` react ` and ` react-dom ` entries without changing the caller's config
89- object. Set ` server: false ` for browser-only remotes.
88+ The Rsbuild adapter emits script-compatible browser output, so its manifest can
89+ be consumed by Vite and Rsbuild hosts. It adds eager, singleton ` react ` and
90+ ` react-dom ` entries without changing the caller's config object. Hosts should
91+ use ` shareStrategy: "loaded-first" ` so one offline remote cannot fail startup.
9092
91- Server federation mode emits ` dist/server/index.cjs ` ; browser-only mode keeps
92- TanStack Start's standard ` dist/server/index.js ` entry.
93+ SSR federation for Rsbuild is experimental and opt-in: ` server: true ` adds an
94+ async-node CommonJS server container and changes the server entry to
95+ ` dist/server/index.cjs ` .
9396
94- ## Example
97+ ## Support status
9598
96- The workspace includes Vite and Rsbuild pairs. ` apps/vite-remote ` exposes a
97- stateful React card to ` apps/vite-host ` . ` apps/rsbuild-remote ` exposes a second card
98- to the Vite host, while ` apps/rsbuild-host ` consumes the Vite remote. Both
99- cross-bundler links use manifest URLs. They render after hydration, so this is
100- browser interop coverage, not an unverified SSR interoperability claim.
99+ | Host | Remote | Browser federation | Federated SSR |
100+ | ------- | ------- | ------------------ | ----------------------------- |
101+ | Vite | Vite | Supported | Supported |
102+ | Vite | Rsbuild | Supported | Not supported |
103+ | Rsbuild | Vite | Supported | Not supported |
104+ | Rsbuild | Rsbuild | Supported | Experimental (` server: true ` ) |
105+
106+ [ ` TODO.md ` ] ( TODO.md ) tracks the remaining SSR work.
107+
108+ ## Examples
109+
110+ The workspace has four TanStack Start apps; see [ ` apps/README.md ` ] ( apps/README.md ) .
101111
102112``` bash
103113pnpm install
104114pnpm start
105115```
106116
107- This starts all four applications so both same-bundler and cross-bundler paths
108- are available. Open the Vite host at http://localhost:3000 or the Rsbuild host
109- at http://localhost:3003 .
117+ Open the Vite host at http://127.0.0.1:3000 or the Rsbuild host at
118+ http://127.0.0.1:3003 . Each host renders a card from both remotes.
119+
120+ ` pnpm test ` builds everything, starts all four apps, and drives both hosts in
121+ headless Chromium. It checks hydration, remote interactivity, console errors,
122+ and the fallback when a remote is offline. Run
123+ ` pnpm exec playwright install chromium ` once before the first local test run.
0 commit comments