@swain-test/micro-ui v1.0.1
A tiny framework for building micro frontend apps using React.
The source code has zero dependencies, and is less than 100 lines of code.
Micro Frontends
To understand the micro-frontend architecture pattern in general, read this article.
Terms
We'll use these terms to talk about the various components of a micro-frotend system:
container app - this is a "shell" SPA that loads + renders many micro-frontends. Think of it as "a nav bar + a micro-frontend loader".
child app - a smaller SPA that is loaded by a container app
The Rules
This framework requires that you stick to a few key rules:
Everything is React. We don't support multiple frameworks.
A "deployed" child app should consist of a single JavaScript bundle, and a single JSON manifest file (child apps should not ship raw CSS or HTML). Manifest files look like this:
{
"name": "my-child-app",
"version": "1.0.0",
"bundle": "https://my-child-app.com/index.js"
}
- Child apps should not include
react
orreact-dom
in their deployed bundles, and should instead rely on the container app to provide these dependencies viawindow.React
andwindow.ReactDOM
.