Production Readiness Status
This document tracks the work completed to move the plugin from a usable beta-quality implementation to a production-grade, GA-ready "best-in-class" Vite Module Federation plugin.
Current Baseline
Already implemented:
- Manifest-first remote consumption through
mf-manifest.json. - Runtime bridge over
@module-federation/runtime. - Manifest fetch cache, TTL, retries, timeout, force refresh, and request collapsing.
- Runtime manifest registration, refresh, debug snapshots, and SSR target selection.
- Manifest, stats, debug artifacts, and traceable build metadata.
- SSR React host/remote example with manifest-driven preload link collection.
- Dev remote live reload coverage and basic devtools overlay/event stream.
- OriginJS-style compatibility shim for
virtual:__federation__. - DTS plugin integration at the build/dev plugin level.
- Core monorepo tooling, CI, format/lint/typecheck/test/build checks.
No concrete production-readiness gaps are currently tracked. The notes below record implemented coverage and future maintenance areas to keep guarded as the public API evolves.
P0 - GA Blockers
These items are completed and remain part of the GA regression bar.
1. Shared Runtime Semantics And Diagnostics
Current state:
- Shared config is normalized and passed into generated runtime code.
singleton,requiredVersion, andstrictVersionare present in generated share metadata.- Local fallback and
import: falsepaths exist. - Several shared prebuild and subpath tests exist.
allowNodeModulesSuffixMatchis normalized, passed to generated runtime share config, matched against pnpm/nestednode_modulessuffixes in the proxy path, and exposed in manifest diagnostics.vite-plugin-federation/runtimeinstalls a shared diagnostics runtime plugin and wrapsloadShare/loadShareSync.getFederationDebugInfo()exposes registered shared providers, the active share scope, and a shared resolution graph with candidate versions, selected provider, fallback source, and decision reason.MFV-003diagnostics are emitted for shared misses, local fallback selection, semver range mismatches, and strict shared resolution failures observed by the runtime wrapper/plugin.- Shared resolution graph entries include deterministic candidate ordering, selected strategy, and
versionSatisfiedforrequiredVersioncomparisons. - Singleton conflicts emit
MFV-003with the selected provider/version and rejected candidate versions. - Shared packages can opt into
strictSingleton: trueto upgrade singleton conflicts from diagnostic-only warnings toMFV-003runtime errors. - Generated local shared providers and internal
loadSharerequests includesourcePathandresolvedImportSourceannotations so runtime debug snapshots can identify the exact local import or resolved file path involved in shared resolution. - Runtime/unit coverage validates package-root, trailing-slash subpath, and pnpm
node_modules-suffix shared matching for Vue-style subpath consumers, scoped workspace packages, and pnpm-resolved package paths. examples/shared-negotiation-hostandexamples/shared-negotiation-remotevalidate deterministicloaded-firstandversion-firstprovider selection in real production build/preview flows.examples/shared-strict-fallback-app,examples/shared-host-only-host, andexamples/shared-host-only-remotevalidate browser-sidestrictVersionlocal fallback and actionableimport: falsehost-only shared errors in production build/preview flows.- Generated shared wrappers throw an actionable host-only error when
import: falseis configured and no host provider is available, and normal shared wrappers fall back to the local prebuild source when runtime share resolution returnsfalse.
Maintenance guardrails:
- No further shared runtime P0 gaps are currently tracked beyond keeping unit and e2e shared diagnostics coverage green.
Acceptance criteria:
- A host can explain why every shared package was resolved from host, remote, or local fallback.
- A singleton/version conflict creates an actionable diagnostic.
- pnpm workspace and symlinked dependency layouts pass both unit and e2e tests.
getFederationDebugInfo()exposes enough shared graph data to debug production incidents.
Implemented commit themes:
feat: add shared resolution graph diagnosticsfeat: support node_modules suffix shared matchingtest: add shared version negotiation coverage
2. Type System End-to-End Coverage
Current state:
@module-federation/dts-pluginis integrated.- Manifest metadata can describe type artifact names.
- Dev worker and dynamic remote type hints are wired.
examples/dts-remotevalidates build-time remote type generation, manifest type metadata, API declaration output, and zipped expose declarations.examples/dts-hostvalidates build-time host type consumption from manifest-derivedremoteTypeUrls,typesOnBuild,consumeAPITypes, andabortOnErrorhappy-path behavior.packages/vite-plugin-federation/e2e/dts-dev-hot-sync.mjsvalidates dev-time live DTS serving, remote type regeneration, host hot type sync, and no-restart host type-checking after a remote API expansion.- Build-time DTS generation/consumption errors are rethrown when the corresponding scoped
abortOnErroroption is enabled. examples/dts-hostvalidates unavailable remote type artifacts fail build-time consumption with a clear missing-types diagnostic whenabortOnErroris enabled.examples/dts-hostvalidates corrupt remote type archives fail build-time consumption with the same deterministic missing-types diagnostic.examples/dts-remotevalidates invalid TypeScript exposes fail build-time generation whengenerateTypes.abortOnErroris enabled.- Unit coverage validates
displayErrorInTerminal, disabledgenerateTypes/consumeTypes, and fully disabled DTS behavior. - Exact DTS workflows, defaults, and recommended production settings are documented in
docs/dts-workflows.md. - Framework runtime examples are covered separately by Vue/Svelte/Lit production builds; the TypeScript/DTS contract is covered by the dedicated TS producer/consumer examples.
Maintenance guardrails:
- No further Type System P0 gaps are currently tracked beyond adding framework-specific DTS fixtures if a concrete Vue/Svelte/Lit type-generation requirement is introduced later.
Acceptance criteria:
- A host can type-check imports from a remote without manual type copying.
- Dev type changes are reflected without restarting the host.
- DTS failures have clear diagnostics and predictable
abortOnErrorbehavior. - Type artifacts are covered in CI, not only by unit-level plugin smoke tests.
Implemented commit themes:
test: add federation dts generation e2etest: add federation dts consumption e2edocs: document federation dts workflows
3. SSR Production Hardening
Current state:
- Node target selection exists.
ssrRemoteEntryis emitted and consumed.- React SSR host/remote example builds.
- Manifest-driven asset/preload helper exists.
- A dedicated SSR Playwright config validates manifest remote server rendering and browser hydration.
- Runtime SSR diagnostics preserve manifest URL, selected remote entry, target, share scope, and remote alias/name on
lastLoadError. - Node SSR entry loader failures are wrapped with actionable
MFV-004guidance for server-side fetch reachability, ESM SSR output, and the current--experimental-vm-modulesrequirement. - The React SSR example injects server-side federation debug data into the HTML, recreates matching browser-side hydration debug data, and fails hydration early if manifest URL, remote id, share scope, or React version diverges.
- SSR e2e validates request-level HTML, server/client manifest consistency, React singleton version consistency, selected node/web entries, remote preload links, host
ssr.external, and remotessrRemoteEntryoutput. - The production runtime guide documents SSR deployment patterns, public path/proxy behavior,
ssr.external/ssr.noExternalexpectations, and the VM module loader migration strategy.
Maintenance guardrails:
- No further SSR-specific P0 gaps are currently tracked beyond keeping the SSR example and e2e matrix green in CI.
Acceptance criteria:
- CI proves SSR host can consume remote and hydrate successfully.
- Server and browser use consistent share scopes and remote manifests.
- SSR failure modes produce actionable error codes and debug snapshots.
- Users have a documented deployment recipe for SSR remotes.
Implemented commit themes:
test: add ssr manifest consumption e2efeat: improve ssr remote diagnosticsdocs: document ssr deployment patterns
4. Manifest Protocol And Schema Freezing
Current state:
mf-manifest.json,mf-stats.json, andmf-debug.jsonare emitted.- Runtime validates a minimal manifest shape.
- Build metadata and plugin version are traceable.
schemaVersionis emitted for manifest, stats, and debug artifacts.- JSON Schemas are committed under
docs/schemas. - Runtime accepts missing legacy schema versions and same-major future versions, while rejecting unsupported major versions.
- Runtime validates malformed known manifest fields and enforces target-specific entry requirements during manifest remote registration.
- Schema compatibility fixtures cover exact
1.0.0, legacy, same-major, and future-major manifest cases. - Generated manifests include
release.id,metaData.buildInfo.releaseId, and entry-levelintegrity/contentHashmetadata for remote entries. - Manifest remotes can opt into runtime remote-entry verification through
registerManifestRemote(..., { integrity: true | { mode } }), with debug snapshots recording successful and failed integrity checks. - Backward/forward compatibility rules and manifest hosting/cache rules are documented as part of the manifest protocol.
Maintenance guardrails:
- No further manifest protocol gaps are currently tracked beyond keeping schema and integrity checks covered in CI.
Acceptance criteria:
- Every generated manifest validates against a committed schema.
- Runtime errors distinguish malformed manifests from unavailable manifests.
- Future schema changes can be tested against fixtures.
- External tools can safely consume the manifest and stats artifacts.
Implemented commit themes:
test: add manifest schema compatibility fixturesfeat: add target-specific manifest validationfeat: add manifest integrity metadata
5. Compatibility Matrix
Current state:
- Basic OriginJS-style
virtual:__federation__shim exists. fromandformatare normalized enough for the main migration path.varFilenamecan generate an additional var-style remote entry.- Unit coverage executes the OriginJS shim APIs for static and dynamic remotes:
__federation_method_setRemote,__federation_method_getRemote,__federation_method_ensure,__federation_method_unwrapDefault, and__federation_method_wrapDefault. examples/originjs-compat-hostandpackages/vite-plugin-federation/e2e/originjs-compat.spec.tsvalidate browser-side OriginJS migration APIs against realremoteEntry.jsandremoteEntry.var.jsassets, while also proving manifest-first and remoteEntry-first remotes can coexist on the same host.- The OriginJS compatibility shim now throws
MFV-005for unsupported legacyformatvalues and missingsystemjsruntimes, and emits a one-timeMFV-007warning for unsupportedfromvalues. examples/react-remoteexposes./ManualCssButtonwithdontAppendStylesToHead: true, and enablesbundleAllCSS: truesoexamples/originjs-compat-hostcan verify the host receives the manual CSS href bucket and injects the stylesheet explicitly.examples/webpack-systemjs-remotegives the repository a real webpack Module Federation remote built withlibrary.type = 'system', andexamples/originjs-compat-hostnow injects a local SystemJS runtime asset before consuming that remote throughvirtual:__federation__.- A compatibility matrix documents supported, partially supported, and unsupported remote formats,
fromcombinations, OriginJS APIs, and CSS migration behavior.
Maintenance guardrails:
- No further compatibility-specific gaps are currently tracked beyond keeping the matrix covered in CI.
Acceptance criteria:
- Common OriginJS migration paths work without rewriting app code.
- Unsupported compatibility combinations fail with clear messages.
- Compatibility logic stays isolated from the main manifest-first runtime path.
Implemented commit themes:
test: add originjs compatibility e2efeat: harden legacy remote format adaptersdocs: add compatibility matrix
P1 - Production Quality Improvements
These production-quality improvements are completed and should stay covered as the plugin evolves.
6. Dev HMR Beyond Full Reload
Current state:
- Remote dev updates can trigger host-side refresh behavior.
- CSS and type update events exist.
- Unit and one Playwright e2e cover the current dev remote HMR path.
- Remote update payloads include strategy, reason, batch id, and a small expose dependency graph so hosts/devtools can explain why partial reload, style update, type update, or full reload was used.
- Remote file events are debounced and duplicate file changes are batched before broadcasting.
- Host partial reload uses Vite
server.reloadModule()for matching remote virtual modules and falls back to full reload when the module cannot be matched or Vite cannot reload it. - Style and type updates remain page-state preserving when the host can refresh stylesheet links or type data without reloading.
docs/dev-hmr.mddocuments strategies, batching, browser events, and fallback rules.
Maintenance guardrails:
- No further Dev HMR P1 gaps are currently tracked beyond adding framework-specific HMR e2e if a framework-specific HMR contract is introduced later.
Acceptance criteria:
- Remote component edits update host without full page reload when the framework supports it.
- Unsupported HMR cases fall back predictably.
- Devtools or debug output explains the chosen reload strategy.
Implemented commit themes:
feat: add remote expose partial hmr graphtest: add react remote partial hmr e2edocs: document dev hmr fallback behavior
7. DevTools And Observability
Current state:
mf-debug.jsonexists.getFederationDebugInfo()exposes runtime state.- Browser runtime dispatches debug events.
- The browser global
window.__VITE_PLUGIN_FEDERATION_DEVTOOLS__now exposes a documentedcontractVersion, bounded event retention, app payloads, the latest runtime snapshot, andexportSnapshot()/copySnapshot()helpers. - The devtools endpoint advertises overlay capabilities and serves the same payload shape injected into the page.
- The built-in overlay renders runtime errors, registered remotes, manifest fetch timeline, shared resolution graph, preload state, and recent devtools events.
- Unit coverage validates endpoint payload shape, injected overlay panels, runtime event publishing, and event retention behavior.
docs/devtools-runtime-contract.mddocuments the stable global contract for external tooling.
Maintenance guardrails:
- No further DevTools-specific P1 gaps are currently tracked beyond keeping the overlay optional and the contract backward compatible.
Acceptance criteria:
- A developer can inspect remotes, shared modules, manifest fetches, and recent errors in one place.
- Runtime debug information is stable enough for external tooling.
- DevTools stays optional and has no production overhead when disabled.
Implemented commit themes:
feat: expand federation devtools overlaydocs: document devtools runtime contracttest: cover devtools debug snapshots
8. Runtime Resilience And Rollout Controls
Current state:
- Manifest fetch has timeout, retry, cache TTL, force refresh, and request collapsing.
- Remote refresh can invalidate manifest cache and update registered remotes.
- Manifest fetch can try an ordered
fallbackUrlslist, and relative remote entries resolve from the manifest origin that actually succeeded. staleWhileRevalidatecan serve an expired cached manifest immediately while a background refresh updates cache and debug snapshots.- Manifest circuit breaker controls can stop repeatedly failing remote manifests for a bounded cooldown window, with
circuit-openevents in the manifest fetch timeline. - Runtime hooks/telemetry cover manifest fetch, manifest remote registration, manifest remote load, and remote refresh with
before/after/errorstages and latency fields. - Runtime debug snapshots expose fallback
sourceUrland manifest circuit breaker state. - Remote-entry integrity checks are available when manifest entry hashes are emitted and runtime verification is enabled.
- Route-level fallback recipes are documented in the production runtime guide.
Maintenance guardrails:
- No further runtime resilience P1 gaps are currently tracked beyond keeping rollout controls covered by unit tests and docs.
Acceptance criteria:
- Hosts can safely roll out remotes across CDN propagation windows.
- Repeated remote failures can be observed and throttled.
- Runtime controls are documented and covered by unit tests.
Implemented commit themes:
feat: add manifest fallback urlsfeat: add runtime telemetry hooksdocs: add remote rollout recipes
9. Compiler Adapter Robustness
Current state:
- Vite/Rolldown differences are handled in several places.
- Control chunks, TLA placeholders, and manual chunk protection exist.
- Remote import named export transforms are covered by unit tests.
- Remote named export transforms now emit sourcemaps with
sourceandsourcesContent, and unit tests validate those fields. - Control chunk sanitizer tests snapshot key output shapes for preload helper removal, load-share preload helper inlining, side-effect import removal, and Vite 8-style helpers.
docs/compiler-adapter.mddocuments Vite/Rolldown adapter rules, control chunk constraints, Vite version policy, and the intentionaltsupCJS named/default export warning.
Maintenance guardrails:
- No further compiler adapter P1 gaps are currently tracked beyond adding explicit multi-version Vite matrix jobs when the example matrix is expanded.
Acceptance criteria:
- Compiler behavior is deterministic across supported Vite versions.
- Manual chunk customization cannot break federation bootstrap ordering.
- Transforms preserve useful source maps.
Implemented commit themes:
test: add vite version compatibility matrixtest: add control chunk output snapshotsfix: stabilize federation transform sourcemaps
P2 - Ecosystem And Documentation Completeness
These adoption and maintenance improvements are completed and should stay aligned with real projects.
10. Example And E2E Matrix
Current state:
- React host/remote examples exist.
- Vue host/remote examples validate SFC remotes, manifest consumption, and shared Vue singleton metadata in production builds.
- Svelte host/remote examples validate Svelte component remotes, manifest consumption, and shared Svelte singleton metadata in production builds.
- Lit host/remote examples validate web component remotes, manifest consumption, and shared Lit singleton metadata in production builds.
examples/multi-remote-hostvalidates one host consuming React and Lit manifest remotes in the same runtime.- A dedicated multi-remote Playwright e2e covers the React + Lit manifest remote combination and is included in the scheduled/manual Extended E2E workflow.
examples/workspace-shared-lib,examples/workspace-shared-remote, andexamples/workspace-shared-hostvalidate pnpm workspace symlink shared packages, exact subpath matching,allowNodeModulesSuffixMatch, and workspace package diagnostics in production build/preview flows.- React SSR host exists.
- Dev remote HMR e2e exists.
test:e2e:browser-matrixreuses the multi-remote manifest scenario across Chromium, Firefox, and WebKit in the scheduled/manual Extended E2E workflow.
Maintenance guardrails:
- No further example/e2e matrix gaps are currently tracked beyond keeping the scheduled browser matrix within CI time budgets.
Acceptance criteria:
- Examples cover the main framework and deployment patterns users will copy.
- E2E tests cover at least one path for every production-critical feature.
- Example commands are documented and run through CI or a scheduled workflow.
Implemented commit themes:
example: add vue federation exampleexample: add dts federation exampletest: add multi-remote federation e2e
11. API Reference And Migration Documentation
Current state:
- README includes quick start and production runtime entry.
docs/production-runtime.mddocuments manifest runtime controls.docs/plugin-api.mddocuments plugin options for remotes, hosts, shared packages, manifest output, devtools, DTS, and compatibility.docs/runtime-api.mddocumentsvite-plugin-federation/runtime, manifest loading, rollout controls, SSR target selection, integrity, hooks, preload helpers, and debug APIs.docs/manifest-protocol.mddocuments manifest schema rules, compatibility fixtures, and hosting guidance.docs/originjs-migration.mddocuments the OriginJS migration path, virtual API mapping, CSS migration, and webpack SystemJS compatibility.docs/troubleshooting.mdis organized byMFV-*error code and links errors to debug snapshot fields and recommended actions.- Existing DTS, compatibility matrix, production SSR, devtools contract, and release checklist docs are linked from README.
Maintenance guardrails:
- No further API/migration documentation gaps are currently tracked beyond keeping references in sync with public API changes.
Acceptance criteria:
- A new user can configure host, remote, shared, DTS, SSR, and compat modes from docs alone.
- Error codes link to troubleshooting steps.
- Migration users can predict required code/config changes.
Implemented commit themes:
docs: add plugin api referencedocs: add originjs migration guidedocs: add troubleshooting guide
12. CI, Release, And Package Quality
Current state:
- CI runs
pnpm check. - CI now installs a clean temporary Vite app from a real
pnpm packtarball and verifies the package can build there. - Package smoke also verifies
sideEffects: falseand checks that production output does not include the devtools overlay bootstrap. - Release workflow validates
pnpm pack --dry-runbefore publishing. - Release workflow is manual-only.
- A separate manual/scheduled Extended E2E workflow runs compatibility, shared runtime, SSR, and DTS dev e2e suites on Node 22 without adding release workflow pressure to normal pushes.
docs/release-checklist.mddocuments Changeset policy, pre-1.0.0versioning policy, package quality gates, release steps, and rollback notes.- Package exports include root and runtime entry.
- Build produces ESM, CJS, and DTS.
Maintenance guardrails:
- No further CI/release P1 gaps are currently tracked beyond keeping release docs and workflows aligned with package policy.
Acceptance criteria:
- A generated package tarball can be installed and used in a clean Vite app.
- CI catches broken exports, missing files, and invalid generated types.
- Release steps are reproducible and documented.
Implemented commit themes:
ci: add package smoke testci: add extended e2e workflowdocs: add release checklist
P3 - Advanced Differentiators
These differentiators are implemented and remain optional extension points for future concrete requirements.
13. Advanced Preload And Performance Optimization
Current state:
createFederationManifestPreloadPlan()generates route-level preload plans from actual route-to-expose usage.- Preload plans support
asyncChunkPolicyvalues for no async chunks, async CSS, async JS, or all async chunks. - The manifest schema accepts optional
preloadhints for route-critical assets and shared runtime assets that are not directly tied to one expose. warmFederationRemotes()registers selected manifest remotes and optionally calls runtimepreloadRemotefor host-side warmups.getFederationDebugInfo().runtime.remoteLoadMetricsrecords registration, load, and total durations for remote module load waterfalls.- Unit coverage validates route preload plans, warm remote behavior, and remote load metrics.
docs/preload-performance.mddocuments the API and performance budget guidance.
Maintenance guardrails:
- No further advanced preload/performance P3 gaps are currently tracked beyond adding broader browser-level budget checks when the example matrix is expanded.
Acceptance criteria:
- Hosts can intentionally warm critical remotes without overfetching.
- Preload behavior is observable and tunable.
14. Security And Supply Chain Controls
Current state:
- Manifest schema defines optional
integrityandcontentHashfields for remote entries. - Manifest schema also accepts object-form expose/preload asset references with optional
integrityandcontentHashmetadata. registerManifestRemote(..., { integrity })verifies manifest-declared remote entries before registration.verifyFederationManifestAssets()verifies annotated expose and preload assets, supportsprefer-integrity,integrity,content-hash, andbothmodes, and can require integrity metadata for every declared asset.- Debug snapshots record successful and failed integrity checks in
runtime.manifestIntegrityChecks. docs/security.mddocuments CORS, CSP, Trusted Types, remote script policy, private manifests, authenticated loading, and signed manifest design notes.
Maintenance guardrails:
- No further security/supply-chain P3 gaps are currently tracked beyond integrating signed manifest verification if a concrete key-management requirement is added later.
Acceptance criteria:
- Enterprise users have a clear security story for remote manifests and assets.
- Security controls are optional and do not complicate the default path.
15. Multi-Tenant And Runtime Instance Isolation
Current state:
- Manifest runtime options accept
runtimeKeyfor tenant or experiment partitioning. runtimeKeyisolates manifest caches, pending manifest requests, manifest source URL tracking, circuit breaker state, registered manifest remote debug records, and remote load metrics.createFederationRuntimeScope(runtimeKey)exposes scoped wrappers for manifest fetch, registration, remote loading, refresh, warmups, and filtered debug snapshots.- Runtime hooks and debug timeline entries include
runtimeKeywhen a scoped runtime is used. - Unit coverage validates same-URL manifest cache isolation and same-alias registered manifest remote diagnostics across separate runtime keys/share scopes.
docs/multi-tenant.mddocuments scoped runtime usage and tenant-specific share scope guidance.
Maintenance guardrails:
- No further multi-tenant P3 gaps are currently tracked beyond adding a browser example if a concrete tenant shell scenario is added to the example matrix.
Acceptance criteria:
- A shell can host multiple tenants or experiments without remote registry collisions.
- Debug snapshots identify the relevant runtime instance.