FynMesh + federation-js at a glance
FynMesh Features
Independently built FynApps run together on one page and share code at runtime through Module Federation. Here is each feature, one picture at a time.
Ship every version. Let each app pick.
Publish fynapp-x1 2.0 next to 1.0. Apps built against 1.x keep getting 1.x. Nobody renames anything or edits a URL.
import("fynapp-x1/main", { with: { type: "mf-expose", semver: "^2.0.0" } })
Join by Loading
Load an app and it joins the page's shared scope. No app lists its peers. Apps that land together share code automatically. See federation-js.
Framework Agnostic
Six frameworks on one loader. There are no bridges or adapters. Each app is a plain federated container.
Legacy RequireJS Bundles
Federated modules serve legacy webpack AMD bundles as RequireJS modules. The bundles are not rebuilt, and they can move to a new React major in stages.
Dependency-Ordered Boot
Ask for one app by name. The kernel reads manifests, builds the dependency graph, and boots providers before consumers. See the kernel docs.
FynUnit Lifecycle
Each app's FynUnit can initialize, execute, suspend, resume and shut down. The kernel tracks which state every app is in.
name@version, so two versions of one app keep separate lifecycles.FynMesh Middleware
One app provides a capability. Others declare useMiddleware and get its API. The demo's design tokens, shell layout and shared counter all work this way.
FynBus
Apps send messages and ask each other questions. The platform stamps who sent each message. It also drops an app's subscriptions when that app shuts down.
Federation Inspector
One call shows what the page holds. You see every shared module, its version, and who provides it. The demo has an in-page inspector too. Read the inspector docs.
| module | version | provided by |
|---|---|---|
| react | 19.1.0 | fynapp-1, fynapp-6-react, fynapp-notes |
| react | 18.3.1 | fynapp-2-react18 |
| fynapp-x1 | 1.0.0 | fynapp-x1-v1 |
| fynapp-x1 | 2.0.0 | fynapp-x1-v2 |
Combined Bundles
Many small modules ship in one file. Each module still acts like its own file. It keeps its URL and runs only when something imports it. The rollup plugin builds them.
federation-combine dist
Small Footprint
The federation layer is under 9 KB gzip. The page loads it once, and every app uses it. See federation-js.
- Embedded manifest. Each app's manifest rides inside its entry file, so one request brings both.
Also built in
MiddlewareStateRegistry
Scoped, reactive shared state for middleware. An app that loads late still sees the current value.
KernelTelemetry
Load and lifecycle events in a bounded ring buffer. Send them anywhere with a pluggable transport.
Dev error overlay
Development builds show a FynApp's bootstrap failure right on the page.
create-fynapp and cfa
Scaffold a new FynApp, then build and check it from the command line.
Start a FynApp
fyn global add create-fynapp create-fynapp