WU / DOCSUNIVERSAL MICROFRONTENDS
EN

WU vs Module Federation and single-spa

Evaluate WU as an alternative for composing microfrontends: compare module loading, application lifecycle, communication and shell responsibilities.

Which problem are you solving?

If you are looking for a Module Federation alternative, distinguish sharing modules from coordinating whole applications. WU organizes applications through registration, loading and lifecycle, and provides a store, events and contracts. Your choice depends on where you want the integration boundary.

The following comparison covers WU 4.0.0, the Module Federation concept documented by webpack and the single-spa application model. It is not a performance test or a comparison of every plugin in their ecosystems.

Compare responsibilities

Decision WU Framework Module Federation single-spa
Integration unit Application with a manifest and lifecycle Modules exposed and consumed across builds Application with loading, activation and lifecycle
Rendering the interface The host asks WU to mount/unmount The consumer decides how to render the module The runtime activates and mounts registered applications
Shared dependencies Explicit build and WU loading configuration Shared module and version configuration A decision for the loading environment and applications
Data between applications Runtime store, events and contracts A contract defined by modules and their consumers A contract defined by applications and shared utilities

Sources: Module Federation in webpack, single-spa’s model and WU APIs. Consult your specific implementation’s documentation if you use a different federation plugin.

When to evaluate WU as an alternative

Evaluate WU when you want to compose applications through a common mounting contract and need state, events or services between them. The criterion is composition and communication, regardless of each application’s technology. Start with a clearly bounded capability and check its integration using the microfrontends guide.

The package includes adapters for React, Vue, Angular, Svelte, Preact, Solid, Lit, Vanilla, Alpine, Qwik, Stencil, HTMX and Stimulus. See their contracts in the adapter reference.

For another technology, register mount and unmount with wu.define, or build an adapter with createWuAdapter. The common contract lets you connect applications using the same framework or different frameworks.

Module Federation is worth evaluating when you need to consume modules from other builds and manage shared dependencies at that level. single-spa is worth evaluating when you want applications with activation rules and lifecycles in a root config. Neither choice removes contract design or deployment operations.

What changes during migration

WU does not automatically interpret a Module Federation remotes configuration or a single-spa root config. Identify each entry point, create its manifest, connect its renderer to the lifecycle and move global decisions to the shell. Define how you will translate existing communication contracts and return to the previous version if a release fails.

The shell maintains global routes; WU does not expose a public router. You should not assume that running modules in the same JavaScript context creates a security boundary either. These responsibilities are explained in architecture.

A test to help you decide

Compare the same capability in your environment: initial load, route change, data updates, unmounting, network failure and a new dependency version. Record transferred size and timings with the same browser and cache conditions. Use the communication example and production output as starting points for WU.

BUILD WU WITH US

Found a bug? Have an idea?

Your experience improves WU. Tell us what went wrong or help support its development.