๐๐จ๐๐๐ซ๐ง.๐ฃ๐ฌ ๐๐ฎ๐ซ๐ซ๐๐ง๐ญ๐ฅ๐ฒ ๐ข๐ฌ ๐จ๐ง๐ ๐จ๐ ๐ญ๐ก๐ ๐๐๐ฌ๐ญ ๐๐ซ๐๐ฆ๐๐ฐ๐จ๐ซ๐ค๐ฌ ๐๐จ๐ซ ๐๐ข๐๐ซ๐จ๐๐ซ๐จ๐ง๐ญ๐๐ง๐๐ฌ.
For legacy setups, companies have been using custom setups or maybe even ๐ข๐๐ซ๐๐ฆ๐๐ฌ to connect multiple front-ends however newer projects shifted to frameworks such as ๐๐ข๐ง๐ ๐ฅ๐-๐๐๐ and ๐๐จ๐๐ฎ๐ฅ๐ ๐ ๐๐๐๐ซ๐๐ญ๐ข๐จ๐ง.
What am I talking?
We are talking about microfrontends. Just like microservices, microfrontend is all about splitting frontend.
But why?
Teams own microservices. But it doesnโt make sense to have teams separated by services but grouped by frontend. A team working on a particular service should have direct control over the frontend specific to that service in that Bounded Context. That couples the service to itโs frontend and enables the team to work in complete isolation.
So somehow we need to split frontend code so that we teams could have thier chunk for their service.
There are various ways to do it:
1. Webpack Module Federation: https://module-federation.io/
Released in 2020, dynamically loads remote apps on runtime. Useful if you have React / Vue / Angular setup.
2. Luigi (SAP): https://github.com/SAP/luigi
Released in 2018, Created by SAP for large enterprise apps.
Get Sankalp Polโs stories inย yourย inbox
Join Medium for free to get updates fromย thisย writer.
3. Single-SPA: https://single-spa.js.org/
Released in 2016, More complex over as compared to MF but you get more power as well. More of a Module orchestration framework.
4. SystemJS: https://github.com/systemjs/systemjs
Released in 2014, Older but light weight. SystemJS is a loader rather than an orchestrator. SingleSPA can use SystemJS internally if you are loading microfrontends remotely.
Microfrontends are not SEO friendly by default unless you are leveraging SSR. So it does depends on the frontend framework (React, Angular, Next) you are implementing microfrontend with. Companies have also created their own ways to internally implement microfrontend.
So how did we reached on Modern.Js
From this issue: https://github.com/module-federation/core/issues/3153
It started with Next.Js being put on maintenance mode. It initially suggested that Next.Js shouldnโt be used if you are exploring microfrontends, while Modern.Js was recommended.
So I started exploring Modern.Js and I found it to be more organized for features like BFF, Microfrontends, SSR, SSG, Data Fetching, Caching, etc.
I will be spending some more time with Modern.Js and some other frameworks. I will also be getting out of Next.Js for a while as it feels like Iโve been wearing a helmet for long time.
Also it is not that Next.Js doesnโt support Microfrontends (Read this: https://nextjs.org/docs/app/guides/multi-zones)
Itโs just that I am bored of Next.Js.
Thatโs it








