Skip to main content

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:

  1. Loosely coupled
  2. Executed independently
  3. Autonomously developed and managed by a small team
  4. Narrowed to a business domain

Hence the name LeanJS.

tip

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.