VOOZH about

URL: https://thenewstack.io/4-lessons-learned-from-building-microfrontends/

⇱ 4 Lessons Learned from Building Microfrontends - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2023-11-10 09:30:58
4 Lessons Learned from Building Microfrontends
sponsor-nitric,sponsored-post-contributed,
Frontend Development / Open Source

4 Lessons Learned from Building Microfrontends

By decoupling databases and improving resiliency, microfrontends give websites and applications the same benefits as microservices provide backends.
Nov 10th, 2023 9:30am by Tim Holm
👁 Featued image for: 4 Lessons Learned from Building Microfrontends
Featured image by La-Rel Easter on Unsplash.
Nitric sponsored this post.

Microfrontends allow developers to break down interfaces into individual, smaller applications, enabling separate teams to develop, test and deploy parts of the web UI independently. Compared to traditional monolithic frontend development, they allow more flexibility in technology choices, facilitating parallel development and improving scalability and resilience, as issues in one microfrontend are less likely to impact the entire application. Essentially, this brings the benefits of microservices — such as modularity and isolation — to frontend development.

Do microfrontends really stand to revolutionize the way we build frontends, or will they lead us down a path of unnecessarily increased complexity and technology fragmentation?

To explore this concept, we built proof-of-concept microfrontends using Nitric‘s framework. We aimed to explore the benefits of microfrontends and test our framework’s ability to build microfrontends and integrate them with Nitric microservices fully end-to-end. Here are four lessons we learned from this experiment.

Lesson 1: Discipline and Consistency Are Key

In the realm of microfrontends, the importance of discipline and consistency cannot be overstressed. When different teams or individuals contribute to the ecosystem, there’s a natural tendency for varying designs, structures and coding conventions to emerge. Having a unified vision and clear guidelines prevent a jumbled codebase and inconsistent user experience. Robust documentation acts as the compass, ensuring everyone, whenever they join, understands the system. Especially for small teams, routine check-ins or code reviews play a pivotal role in unifying direction. Having an automated testing process, including unit, integration and end-to-end testing, further solidifies this aligned approach and improves quality consistency.

Lesson 2: More Tools Lead to More Complexity

The allure of microfrontends often lies in the freedom to choose the right tool for a specific task. However, excessive technological variation can lead to productivity losses, particularly for compact teams that might not have a broad spectrum of expertise. Every tech decision drags along its baggage — learning curves, maintenance requirements or even something as tangible as bundle size. Further complications arise when addressing shared libraries and dependencies. The strategic decision — whether to bundle them into individual microfrontends or maintain a shared resource — has extensive implications, particularly regarding loading performance and version compatibility.

Lesson 3: Performance Strategies Are Vital

Integrating multiple microfrontends is reminiscent of piecing together a dynamic puzzle. Managing routes across microfrontends introduces complexities around defining routes, supervising the primary router, and aspects like nested routing or lazy loading. Performance, too, demands attention. The act of loading several microfrontends, particularly if their dependencies diverge, can usher in potential performance bottlenecks. Strategies such as employing shared content delivery networks (CDNs), bundle optimization and tree shaking become invaluable. Equally vital is a robust error-handling mechanism; a glitch in a single microfrontend should not jeopardize the entire application’s stability.

Lesson 4: Be Thoughtful about Using Shared State

Navigating the intricacies of shared states and intercomponent communications often feels like walking a tightrope. For microfrontends demanding a shared state, management becomes a complex challenge. Identifying a suitable mechanism or library that facilitates state sharing is crucial. In scenarios where direct state linkage isn’t a requirement, an event or messaging paradigm is a potential solution that decouples the microfrontends and enhances flexibility. However, shared states or messages mean you need clear contracts or APIs for delineating data sharing and updates. Implementing a thoughtful versioning strategy for these contracts can smoothly accommodate changes, safeguarding against inadvertent breaks in existing components.

Final Insights

We likely won’t be moving to a full microfrontends approach anytime soon, but the benefits are evident. This approach is hugely beneficial to teams needing to share common components across multiple frontends; for example, a single team can develop a chatbot interface and drop it into a monolithic frontend seamlessly, much like how many use Software as a Service (SaaS) products today. There is no need to make a full cutover; instead, you can progressively renovate, pull out the parts that make sense and you can use them later, and mix and match them with monolithic applications.

For more insight, check out a simplified version of what we built over at GitHub.

Nitric is the cloud-aware framework that enhances developer productivity and ops confidence, uniting backend and infrastructure code to build and ship cloud apps fast. Devs build your application, Platform determines the right infrastructure and Nitric automates provisioning that works for both.
Learn More
The latest from Nitric
Hear more from our sponsor
TRENDING STORIES
Tim Holm, CTO of Nitric, enjoys building great technology and open source software that developers love. Tim has a range of experience working across industries, such as government and fintech, architecting and implementing highly available and scalable software. Tim and...
Read more from Tim Holm
Nitric sponsored this post.
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.