Moving fast, with microfrontends!
This week i want to highlight this article from one of the lead developers of the Twitter Lite PWA Paul Armstrong. Despite what’s currently going on at Twitter i always admired this application and the way it was built using react-native-web trying to provide a similar experience to a native application.
But what i found more interesting in the article was this section “Split into multiple applications with module federation“
One thing that we struggled with was moving fast on really small parts of the application, eg, “Settings”. Because everything in the application was interconnected and controlled by a single Node.js process, this made reviews, CI, and deploys slow. We could have, however, split things into multiple applications.
He talks about trying to use module federation to “separate applications that reference each others shared code to avoid duplication, reduce footprints, allow faster builds and deploys, and much more.“
It’s great to see developers that worked in these popular large applications both in terms of number of developers and requests, with strict performance requirements starting to recognize value in the concept of microfrontends (which is essentially what’s being described in the article). This helps to avoid the stigma usually associated with these architectures of running multiple frameworks in the same page and overall javascript bloat.
Concluding the article he also mentions:
While I strongly believe the solutions outlined here would work well, they’re all theoretical and/or opinion-based. If this were actually a project that I would be working on, I would first ensure proof-of-concepts were made for everything and get buy-in from both direct and supporting teams in my organization
This is something i believe is of the utmost importance, and something i also want to focus on related to module federation. I’ve seen many articles mentioning how to take advantage of federation but very few deeply assessing the trade-offs around it.
Stay tuned!
Interesting links:
An interesting case-study about a company that was facing scaling issues with their frontend application and how they decided to split it
https://engineering.razorpay.com/monolith-to-module-federation-8c400b4e5646
A great talk as always by Luca Mezzalira on some of the anti-patterns he has seen with his experience in microfrontends