Repository navigation
fix: stabilize TanStack SSR remote revalidation - #5
Merged
Nsttt merged 1 commit intoOct 10, 2026
Merged
Conversation
commit: |
Nsttt
approved these changes
Oct 10, 2026
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
TanStack Start SSR hosts cache remote server entries and Module Federation containers for the lifetime of the Node process by default. This change adds TTL-based revalidation so a running host can load a redeployed remote, while preventing duplicate fetch/evaluation during an expiration window.
Rsbuild hosts now handle both Rsbuild CommonJS remotes and Vite ESM remotes through the same Node entry-loader path, while Vite hosts preserve
ssrEntryLoaderoptions for the upstream Vite adapter.Changes
maxAgeMsis configured, the loader records the time of a successful remote load and measures the TTL from that entry load.lastLoadedAt, so repeated expose requests cannot postpone remote-entry revalidation indefinitely.registerRemotes(..., { force: true })invalidates the runtime container/module cache before the next remote entry load.remoteEntry.ssr.cjsas a Node CommonJS module.revalidate()and the cache owned by@module-federation/vite/ssrEntryLoader.strategy,fetchTimeoutMs, andfetchMaxBytesare forwarded to the Vite SSR loader.fetchTimeoutMs: 0disables timeouts for CommonJS requests and Vite fallback requests.NodeEntryLoaderOptionstype instead of accepting arbitrary option keys.lastLoadedAtregression, concurrent TTL revalidation single-flight, and disabled timeouts.@module-federation/tanstack.Runtime Behavior and Limitations
maxAgeMs, remotes remain cached until the host process exits, as before.loadRemote()request after the TTL expires.maxAgeMsis version-aware when the remote is resolved frommf-manifest.json. Direct or convention-based server-entry URLs may require an explicitrevalidate()call.Validation
pnpm test: 65 tests passed, including the full build and Vite/Rsbuild client/SSR interoperability checkspnpm typecheck: 8 packages passednode --test --test-concurrency=1 test/release-contracts.test.mjs: 26 tests passed, including the latest option-forwarding contractspnpm exec prettier --check packages/tanstack/README.md TODO.md test/release-contracts.test.mjs: passed