Micro Frontend with React.js and Module federation
5 min readNov 9, 2021
What is a micro frontend?
The Micro Frontend style of architecture design does for the frontend of an application what microservices do for the backend, breaking monolithic structures into smaller components that can then be assembled on a single page.
The Complete Guide to Micro-Frontends for 2023 | DevsMitra — YouTube
Pros and cons of micro frontend:
Pros:
- A micro frontend is more modular and reusable.
- A micro frontend is more scalable.
- The micro frontend is more maintainable.
- Independent and Faster development.
- Testing separate applications are easy.
- Different front-end technologies can be used for different projects(like React, Angular, Vue.js, etc).
Cons:
- Testing the entire application is not easy.
- Sharing code, state(data), etc is not easy.
Module federation (Module Federation | webpack)
Module Federation allows a JavaScript application to dynamically load code from another application and in the process, share dependencies. If an…