Getting started
Micro-frontends
Designed for several independently deployed applications on one page — and tested that way.
How ReactLoom stays isolated
| Concern | Approach |
|---|---|
| React | Peer dependency — share it as a singleton. |
| CSS collisions | Hashed class names (pl-button-root-x7Ab2), everything inside @layer, no element selectors. |
| Two library versions | Compatible versions coexist: class names differ, token names are semver-stable. |
| Themes | DOM-scoped. A remote inside the host’s provider inherits its theme without sharing JavaScript. |
| Overlays | Modal dialogs use the browser top layer: no z-index contest, no portal container. |
| Scroll lock | Coordinated through attributes on <html>, so overlays from different copies cooperate. |
| Global state | None — no singletons, registries or window globals. |
Module Federation
federation({
name: 'host',
remotes: {
billing: { type: 'module', name: 'billing', entry: 'https://billing.example.com/remoteEntry.js' },
},
shared: {
react: { singleton: true, requiredVersion: '^19.0.0' },
'react-dom': { singleton: true, requiredVersion: '^19.0.0' },
// @reactloom/ui is not shared: each remote ships the version it was tested with.
},
})Load @reactloom/theme/theme.css once in the host; each remote imports its own @reactloom/ui/styles.css.
What is tested
The host and billing remote build with the current workspace UI. The support remote builds with a packed snapshot from the first working UI commit. Browser tests check that the builds coexist with a single React instance, keep their own CSS, inherit the host theme, and isolate remote failures.