Repository navigation
fix: unify Vite and Rsbuild runtime fetch policies - #8
Merged
Merged
Conversation
commit: |
Nsttt
approved these changes
Oct 13, 2026
Closed
Merged
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
Vite and Rsbuild remote server-entry and manifest fetch paths used different timeout, response-size, and cache behavior. This change applies one fetch policy so remote loading cannot hang indefinitely or consume unbounded response bodies.
This package delegates Federation build and container wiring to
@module-federation/viteand@module-federation/rsbuild-plugin, but it owns adapter boundaries for CommonJS entry compatibility in the Rsbuild development environment and server-side manifest/CSS lookup. Those boundaries had diverged fetch-safety policies for the same remote.Context
@module-federation/vite/ssrEntryLoaderprovides timeout and response-size options for Vite ESM entries, butgetRemoteStylesheetsand Rsbuild CommonJS entries used separatefetchpaths.@module-federation/rsbuild-pluginand@module-federation/enhancedown build/container/runtime wiring; they do not expose a stable public API for manifest CSS lookup or a shared response-body limit.@module-federation/rsbuild-plugin's runtime, reimplementing the Vite SSR loader, or changing React SSRErrorBoundaryfallback behavior.Changes
remote-fetchlayer with 10-second and 10 MiB defaults. Passing0disables either limit, while HTTP status,Content-Length, streaming bodies, and JSON parse failures are handled consistently.@module-federation/vite/ssrEntryLoaderwith the same fetch options.RemoteEntryErrorphases and original causes remain unchanged.fetchTimeoutMsandfetchMaxBytestogetRemoteStylesheets. Manifest requests now single-flight in-flight work, reuse only successful responses for the TTL, and evict failed requests from the cache.@module-federation/rsbuild-pluginclient/server Federation wiring and the custom CommonJS_compilepath unchanged. Added theremote-fetchbuild artifact and updated release artifact coverage.RemoteEntryErrorphases/causes, manifest CSS URL resolution, the default 30-second manifest TTL, andfetchTimeoutMs: 0opt-out behavior. The newgetRemoteStylesheetsfetch options keep existing callers' default behavior unchanged.Validation
pnpm --filter @module-federation/tanstack typecheck: passedpnpm --filter @module-federation/tanstack build: passednode --test --test-concurrency=1 test/runtime.test.mjs: 18 passednode --test --test-concurrency=1 test/remote-fetch.test.mjs test/release-artifacts.test.mjs test/release-contracts.test.mjs: 32 passed