# WU vs Module Federation and single-spa

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

<span id="qué-problema-estás-resolviendo"></span>

<span class="section-anchor" id="section-1"></span>

## 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.

<span id="comparación-de-responsabilidades"></span>

<span class="section-anchor" id="section-2"></span>

## 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](https://webpack.js.org/concepts/module-federation/), [single-spa's model](https://single-spa.js.org/docs/getting-started-overview/) and [WU APIs](/api/). Consult your specific implementation's documentation if you use a different federation plugin.

<span id="cuándo-evaluar-wu-como-alternativa"></span>

<span class="section-anchor" id="section-3"></span>

## 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](/docs/guides/microfrontends/).

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](/docs/framework/api-adapters/).

For another technology, register `mount` and `unmount` with `wu.define`, or build an adapter with [`createWuAdapter`](/docs/framework/api-adapters/#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.

<span id="qué-cambia-al-migrar"></span>

<span class="section-anchor" id="section-4"></span>

## 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](/docs/guides/architecture/).

<span id="una-prueba-para-decidir"></span>

<span class="section-anchor" id="section-5"></span>

## 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](/docs/guides/shared-counter/) and [production output](/docs/guides/production/) as starting points for WU.