All we know about Microservices, which helps to develop features individually. Same way, we can do it with frontend applications. I mean, your application can be divided into various small individual applications. Aka Micro Frontends.
We can develop the main parent app which will contain the authentication and routing implemented, and we can then proceed to adding multiple child apps which work independently and can be loaded on either the same or different pages.
There are two main ways to build micro-frontends:
This is most commonly used division
For example: we can divide features of the dashboard into three micro-frontends.
Apps can be divided as per domain
for example, we can divide the app in Core domain, payments domain, profile domain, ...
Since each MFEs are placed in different locations, we need to have a base which will render the application. Here are few ways :
- Webpack module federation example
- Web components
- H-include library
- Single SPA library
As mentioned before, the micro-frontends are completely independent of each other, but we can have them communicate with each other on certain events by using a library like an Eev event bus.
- Team scalability: There would be isolated teams of code, and so we don't share a runtime, we don't rely on a shared state or global variables.
- Technology Agnosticism: each team should be able to choose and upgrade their stack without any coordination with other teams.
- No Standards
Top comments (0)