Micro-Frontends implementation
This page documents the checked-in realization of the Micro-Frontend architecture
and ties each concrete detail back to the directive it satisfies. It reflects the
source in alya-fe/app-shell, incidents-management-fe, the domain MFE repositories,
and fe-packages/. It does not assert that any environment is currently deployed or
healthy — it describes the configuration present in the repository.
Authorities, in order:
- Each app’s
rsbuild.config.tsis the authority for build-time federation (name,exposes,shared). - The shell’s runtime config (
window.RUNTIME_CONFIG.REMOTE_MFES) is the authority for which remotes load where. pnpm-workspace.yaml+ each@fe-ws/*package.jsonare the authority for build-time shared packages.
Toolchain
- Bundler: Rsbuild (
@rsbuild/core,@rsbuild/plugin-react). - Federation:
@module-federation/rsbuild-plugin(build) and@module-federation/enhanced/runtime(runtime registration/loading). - Package manager / monorepo: pnpm workspaces; Turborepo for task orchestration.
- Manifest: remotes publish
mf-manifest.json(not a bareremoteEntry.js); the shell points each remote entry at<origin>/mf-manifest.json.
Realizes the Rsbuild is the sanctioned toolchain design rule (architecture). Vite’s MF plugin is not used.
Step-by-step: how a shell and its MFEs are wired
Declare the shell as a host with shared singletons
Owner: FE Guild (shell)
alya-fe/app-shell/rsbuild.config.ts registers the host with
pluginModuleFederation({ name: 'alya_shell', shareStrategy: 'loaded-first', shared: { … } })
and no exposes. React, React Router, MSAL (@azure/msal-react /
@azure/msal-browser), @mui/material, @emotion/react, @mui/x-date-pickers-pro,
notistack, @tanstack/react-query (+ broadcast), @fe-ws/mfe-utils, and the
Application Insights packages are all declared singleton: true. The shell shares
them eager: true because it loads first.
- Realizes Shared runtime singletons and Shell owns cross-cutting concerns only.
@emotion/styledand@mui/icons-materialare intentionally absent fromshared— see step 6.
Expose remote surfaces from each MFE
Owner: MFE team
Each domain MFE declares name + exposes in its rsbuild.config.ts:
service-management-fe→name: 'mfe_service_management',exposes: { './App': './src/mfe-app.tsx' }customer-info-fe→name: 'mfe_customers',exposes: { './App': './src/mfe-app.tsx' }incidents-management-fe→name: 'mfe_incidents_management',exposes: { './App': './src/mfe-app.tsx' }reichenbach-fe→name: 'mfe_iwkb', exposes the five Investigation cards (AiAgentCategorizationCard,InitialFactsCard,AssessmentCard,KeyFindingsCard,HypothesisCard)bondi-fe-core→name: 'bondi_core', exposesApp,LandingPage,AuditLogPage,GlobalConfiguration, release-notes surfaces, …
Remotes keep heavy UI libs non-eager (@mui/material, @mui/x-date-pickers-pro
are singleton but not eager) so remoteEntry/manifest stays small and they reuse
the host’s already-loaded copies.
- Realizes One MFE owns one domain end to end and the share non-eagerly in remotes rule in composition.
Resolve remote origin per environment
Owner: MFE team
Each remote ships a remote-origin.util.ts runtime plugin wired via
runtimePlugins. It reads document.currentScript.src, derives the serving origin,
and stores it on window.__IMFE_ORIGIN__, so a remote’s own assets resolve correctly
whether it is loaded standalone, by a shell, or by a sub-shell. The shell/sub-shell
registration also switches entry origin by ingress: https://agw- hosts use the AGW
entry, otherwise the Front Door (AFD) entry. See routing and ingress for
the full ingress and origin-resolution model.
- Realizes Independently deployable — the same remote build serves any environment and any host without rebuilding.
Register and load remotes at runtime
Owner: FE Guild (shell)
The shell does not hard-code remotes. src/config/mf.util.ts maps
window.RUNTIME_CONFIG.REMOTE_MFES into descriptors
(entry: <origin>/mf-manifest.json) and calls registerRemotes(...) on the instance
from getInstance(). A route resolving to a remote triggers a lazy
mfInstance.loadRemote('mfe_x/App') inside an error boundary HOC.
The alpha shell config currently registers: mfe_service_management (3001),
mfe_customers (3002), mfe_security_posture_improvement (3003),
mfe_incidents_management (3004), mfe_daedalus (3100),
mfe_ion_iq_automation_workflow_recommender (8011), mfe_ion_iq_investigator (8031),
mfe_ion_iq_filtering_rules (8041), and mfe_iwkb (3110).
- Realizes Shell owns remote loading;
shareStrategy: 'loaded-first'means shared singletons resolve only as remotes are actually loaded, avoiding a boot-time storm.
Compose the Incidents sub-shell
Owner: Alya + SOC + MDR-DS teams
incidents-management-fe is a Provider and a Consumer. It exposes './App' to the
Alya shell and runs its own registerRemotes(...) (same mf.util.ts pattern) for
the remotes it consumes. It loads them through an authorization-aware HOC,
withAuthorizedRemoteMF(remote, roles):
mfe_iwkb/AiAgentCategorizationCard,/InitialFactsCard,/AssessmentCard,/KeyFindingsCard,/HypothesisCard(Investigation)mfe_ion_iq_investigator/IonIqInvestigatormfe_ion_iq_filtering_rules/IonIqFilteringRules,/IonIqInsights
The Alya shell does not load Investigation or ION IQ for the incident journey; the Incidents MFE owns that composition and gates each remote on the required roles.
- Realizes Sub-shell composition is explicit and Decoupled by contract — the
contract is the exposed component names + props, and deep-link routes such as
/incidents-management/incident/investigation/:selectedTicket.
Keep shell providers global and MFE state local
Owner: FE Guild + MFE teams
Cross-cutting React providers — Theme (MUI), MSAL, Notifications (Notistack),
Telemetry (App Insights) — are provided by the shell and consumed by MFEs (a
documented reverse dependency). Each MFE keeps its own QueryClient /
QueryClientProvider so it cannot invalidate another MFE’s cache.
Two deliberate non-sharing decisions are enforced in every config:
-
@emotion/styledis not shared — it is a stateless factory consumed by@emotion/react; federating it breaks its default export at runtime. -
@mui/icons-materialis not shared — shared modules cannot be tree-shaken, so sharing it would ship the full ~4 MB icon barrel. Code uses deep imports (@mui/icons-material/Close) so only used icons are bundled. -
Realizes the provider-boundary table and shared-dependency rules in composition.
Support standalone mode
Owner: MFE team
Each MFE’s index.tsx boots through an async import('./bootstrap') boundary. In
standalone mode the MFE supplies its own auth, routing, theme, and telemetry; in
federated mode it consumes the shell’s shared singletons. The async boundary is what
lets a single build run both ways and is why heavy singletons can stay non-eager in
remotes.
- Realizes Independently deployable / testable — an MFE can be developed and verified without the shell.
Consume shared libraries at build time
Owner: FE Guild (library) + MFE teams
The design system and tooling ship as pnpm workspace packages under fe-packages/:
@fe-ws/theme, @fe-ws/shared-ui, @fe-ws/shared-utils, @fe-ws/mfe-utils,
@fe-ws/signalr, @fe-ws/storybook, @fe-ws/tsconfig. They are consumed as versioned
workspace: dependencies — a visual change ships as a dependency bump, not a runtime
broadcast. @fe-ws/mfe-utils and @fe-ws/signalr are additionally Module Federation
singletons, so the shell and remotes share one runtime instance. For @fe-ws/signalr
that is what shares the shell’s single SignalR connection with every MFE
(real-time).
- Realizes Shared libraries are consumed, not federated (architecture).
Shared-dependency matrix (as configured)
| Dependency | Shared | Singleton | Eager in shell | Eager in remotes | Note |
|---|---|---|---|---|---|
react, react-dom, react-router | ✅ | ✅ | ✅ | ✅ | Core runtime |
@azure/msal-react, @azure/msal-browser | ✅ | ✅ | ✅ | ✅ | Shell-owned auth context |
@tanstack/react-query (+ broadcast) | ✅ | ✅ | ✅ | ✅ | One client context; cache stays per-MFE |
@mui/material, @emotion/react | ✅ | ✅ | ✅ | ❌ | Remotes reuse host copy; keep remoteEntry small |
@mui/x-date-pickers-pro | ✅ | ✅ | ✅ | ❌ | Must be the host’s single instance (adapter/context) |
notistack | ✅ | ✅ | ✅ | ✅ | Shared Snackbar context |
@fe-ws/mfe-utils | ✅ | ✅ | ✅ | ❌ | Shared workspace util |
@fe-ws/signalr | ✅ | ✅ | ✅ | ✅ (Reichenbach) | Shares the shell’s single SignalR connection. Any remote that uses live updates MUST declare it as a singleton; today the shell and Reichenbach do |
| App Insights packages | ✅ | ✅ | ✅ | ❌ | Reuse shell’s telemetry singleton |
@emotion/styled | ❌ | — | — | — | Stateless factory; federating breaks it |
@mui/icons-material | ❌ | — | — | — | Not tree-shakeable when shared; deep-import instead |
Eagerness varies by app; the shell is the eager reference and remotes trend non-eager
for heavy UI libraries. The authoritative values live in each rsbuild.config.ts.
Known gaps / TBD
- Production and per-environment hostnames for
mfe_incidents_management,mfe_iwkb, and the ION IQ MFEs were not resolvable from checked-in sources (see shells and MFEs). - The capability-based authZ contract is served by Signet
(
GET /v1/capabilities,POST /v1/validations; see Capability service (Signet)). FE/BFF adoption is rolling out per MFE; current MFEs still also gate remote consumption on role arrays (e.g.withAuthorizedRemoteMF(remote, [UserRole.…])).
Related documentation
- Architecture · Composition · Routing and ingress · Identity and access · Real-time (SignalR) · Capability service (Signet) · Shells and MFEs
- ADR-0023 — Micro-Frontend (MFE) UI architecture
- Pattern — MFE UI Interaction
- Source references: MFE - Real Example (Alya) · Monorepo Strategy for Frontend Code Sharing · Sharing deployment - MFE