Repository navigation
Conversation
dmchoi77
force-pushed
the
fix/router-context-ssr
branch
from
October 10, 2026 14:15
844cfd1 to
edada41
Compare
commit: |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix an issue where an Rsbuild SSR Host and a Vite SSR Remote could evaluate separate React/TanStack Router runtimes, preventing the Remote from reading the Host's
RouterProvidercontext. React and TanStack Router runtimes are now aligned to the Host's singleton instances so SSR, hydration, and Remote navigation use the same context.Problem
Rsbuild SSR Host + Vite SSR Remote. The Host renders each request through itsRouterProvider, while the Remote consumes the Host Router context throughLinkoruseNavigate.reactandreact-dom, so@tanstack/react-routerand@tanstack/router-corecould be evaluated separately in the Host and Remote SSR graphs./__mf_ssr__/run through the Remote dev server's Vite 8ModuleRunnerand optimized dependency paths. If that path evaluates files different from the Host's share scope, the Host Provider and Remote hook reference different module-level context objects.protocolAllowlist-relatednullerror. Remotes that render only static markup may not expose the problem because they do not consume Router context.Changes
packages/tanstack/src/shared.tsreact,react-dom,@tanstack/react-router, and@tanstack/router-core.packages/tanstack/src/vite.tsremotesconfiguration and apply eager shared defaults for Hosts.packages/tanstack/src/rsbuild.tsimport,scope, andshareKeysettings.packages/tanstack/src/node-entry-loader.ts@tanstack/react-routeror TanStack Start package roots when pnpm does not expose them from the app root./__mf_ssr__/entries through Vite 8ModuleRunnerwith a host-aware transport.@module-federation/viteSSR loader and apply the custom transport only to development entries.Validation
pnpm test: all 61 tests passedpnpm --filter @module-federation/tanstack typecheck: passedpnpm --filter @module-federation/tanstack build: passednode --test --test-concurrency=1 test/runtime.test.mjs test/release-contracts.test.mjs: 36/36 passedpnpm exec prettier --check packages/tanstack/src/node-entry-loader.ts packages/tanstack/src/rsbuild.ts packages/tanstack/src/shared.ts packages/tanstack/src/vite.ts test/release-contracts.test.mjs test/runtime.test.mjs: changed-file formatting checks passedprotocolAllowlisterror