What is LeanJS?
LeanJS is a stack of solutions for building scalable front-end applications. These solutions integrate with existing technology, and can be grouped in the following six layers to build a full micro-frontends architecture:
ββββββββββββββββββββββ
β Deployment β AWS
ββββββββββββββββββββββ
ββββββββββββββββββββββ
β Workspace β Turborepo, Lerna
ββββββββββββββββββββββ
ββββββββββββββββββββββ
β Routing β Nextjs, Vue Router, React Router
ββββββββββββββββββββββ
ββββββββββββββββββββββ
β App composition β React, Vue
ββββββββββββββββββββββ
ββββββββββββββββββββββ
β Shared runtime β Vue, React
ββββββββββββββββββββββ
ββββββββββββββββββββββ
β Shared code β Webpack Module Federation
ββββββββββββββββββββββ
What are micro-frontends?β
Micro-frontends is a software architecture for building distributed frontend applications. In this architecture, a frontend application is composed of smaller frontend applications. We believe that successful micro-frontend implementations are LEAN:
- Loosely coupled
- Executed independently
- Autonomously developed and managed by a small team
- Narrowed to a business domain
Hence the name LeanJS.
Micro-frontends help organisations scale engineers. Its benefits don't correlate with the size of the codebase but with the number of engineers working on it.
Micro-frontends don't solve technical problems, they solve people problems.
You may not need micro-frontendsβ
Micro-frontends help break up Web-based products into smaller independent ones that can be developed, deployed, and run by small independent groups of people.
That's typically a requirement when an organisation wants to develop more features faster but incrementing the number of engineers contributing to a product doesn't increment the output proportionally. In other words, they fail to scale people.
You don't need micro-frontends if:
- You don't have problems scaling engineers.
- You have one team or a few small ones.
- Your lead time, code to market, and mean time to recovery metrics are fine.
- You want to avoid the increased complexity in observability, releasing, testing, etc of running distributed systems.
The good news is, you can still use LeanJS to build the foundation of a distributed architecture without fully committing to it. You may start using LeanJS app composition layer and shared runtime layer, and never go all the way to independent deployments - also known as micro-frontends. A modular monolith is more scalable than a monolithic big ball of mug.
Why another Framework?β
LeanJS is born from the need to break up monolithic front-end applications in different companies. Most micro-frontend projects start by breaking up an existing monolith rather than building a brand new product using micro-frontends from the start.
Although most micro-frontend architectures will face similar problems, every front-end monolith has its own requirements and tech stack. That's why many organisations - Amex, Hopin, DAZN, Netflix, Cazoo, Zalando - end up building their own solutions instead of using off the shelf micro-frontends solutions.
That's not to say that existing micro-frontend frameworks don't work. Your requirements might be implemented using frameworks such as single-spa, like IG did.
We believe that organisations should be able to incrementally integrate and reuse solutions within their unique monoliths without reinventing them. LeanJS is not a single, standalone framework. It's an opinionated stack of solutions that you can reuse to build your own stack.