If you're not using Webpack, there's some other options like native federation. Some other options include web components and iframes. For managing all of this, we use a monorepository with index, which provides an extensible build system and an integrated environment for developing apps with popular frameworks. With micro frontends, we can deliver a single web application by wrapping individual frontends into a host application. Benefits include incremental upgrades, deployment independence, and team autonomy. However, there are downsides such as poor performance, large bundle sizes, increased browser workload, style conflicts, and complexity.
If you're not using Webpack, there's some other options like native federation. And this is a browser native implementation of the module federation idea. And this is actually able to be used with any framework or build tool.
Some other options, web components have been around for quite some time, as well as iframes. And you could even do the JavaScript orchestration yourself.
Now, for us in particular to manage all of this, we actually use a monorepository with index. And index provides an extensible build system, allows you to use modern tools like Cypress, Jest, Prettier in a standard way across all the applications in your repository. And it provides an integrated environment for developing apps with popular frameworks like Angular, React, Node.js, making it easier to manage code sharing and minimize redundancy.
All of this comes together with cool features like computational caching, effective commanding, code generation, which streamline the developer experience and process.
Now that we know the tools, instruments and controls, I think we're ready to navigate. So, if we go back to that really scary picture, we have this huge frontend and all of these backend services. But what we want is something like this where everything is separated. And we can still have that while delivering a single web application by using micro frontends where we wrap these individual feature based frontends into a host application. And if you do it right, it might look something like this where we have a menu that has a lot of options. And every single one of these options in the menu is actually an independently built frontend.
Some of the benefits of micro frontends include incremental upgrades. You can break your application down piece by piece, introduce new technology, frameworks, packages and maintain your velocity while also taking care of technical debt. You also gain a lot of deployment independence. Your applications are decoupled and you have less chance of negative impact from other teams. And all of this kind of comes together to enable team autonomy. You don't have to coordinate so much with each other and you gain freedom in choosing the tools and frameworks that you want to use.
Now, whatever benefit, there's also downsides. You can have poor performance if not well architected. You can have really large bundle sizes. You can increase your browser workload. So, you need to be very careful about how you're orchestrating this during runtime. You can also run into trouble with styles. Different teams are using different styling approaches. You could introduce conflicts leading to inconsistent UI. And, of course, complexity.
Comments