MicroFrontends Final Guide
MicroFrontends Final Guide
MicroFrontends Final Guide
Micro Frontends
for Mobile
Table of
Contents
Introduction 03
Section 01
How mobile apps are built today 04
Section 02
The definition of micro frontends 07
Section 03
Considerations when adopting a micro
frontend architecture 10
Section 04
Best practices for organizing teams when
implementing micro frontend architecture 12
Section 05
Most common use cases 23
Summary 26
Introduction
Mobile application development, whether native or hybrid, has historically come
with a variety of challenges, especially in larger organizations. Scaling development,
maintaining feature parity across platforms, and constantly deploying bug fixes are
just a few of the more common issues. Development teams at large enterprises are
nothing if not persistent, so many of these issues have just become part of the
mobile application development process.
This ebook will explore how micro frontend architecture can alleviate some of the pain
points typical in large-scale application development. We will cover the definition of
micro frontends, advantages and disadvantages of implementing micro frontends in
mobile app development, and best practices around adopting micro frontends within
your organization.
SECTION 01
The application uses a monolithic architecture, which requires the team to build
the application together using a single code base. Whenever the app needs to
be updated, the entire stack needs to be compiled and deployed in unison.
Outcomes IT leaders
and architects want to see
As demand to curb costs while maintaining or improving customer
experience become high priority in enterprise organizations, IT
leaders and architects are tasked with finding ways to implement
these priorities within their teams by improving the mobile
application development process.
The current way to build apps with a monolithic architecture fails to satisfy all of these
outcomes in large enterprises.
The definition of
micro frontends
In short, micro
frontends are all about
slicing up big and scary
things into smaller,
more manageable
pieces, and then
being explicit about
the dependencies
between them.
Cam Jackson
Full-stack web developer and
lead consultant at Thoughtworks
Coined by Thoughtworks in 2016, the term micro frontends refers to the concept of breaking
up the frontend of an application into different feature slices or segments. Micro frontend
architecture is counter to the monolithic architecture approach as it allows different teams to
work on different parts of the application simultaneously. Each team can own a given feature
end-to-end, which ensures a focused experience for development teams and an overall cohesive
experience for customers.
The current way to build apps with a monolithic architecture fails to satisfy all of
these outcomes in large enterprises.
Micro frontends increase scalability by making it easier to integrate new features and
updates, since each component can be updated independently without impacting the
rest of the application.
When organizations scale they start to build teams that have a more specific focus. As
micro frontends are usually separated based on feature, each team can focus on their
area of expertise.
Micro frontends ultimately reduce complexity among development teams. They allow
teams to keep their area of ownership more manageable. This makes it easier for teams
to work on their own features in parallel and with their own timelines for releases.
native apps ensure common functionality meets the needs of each group.
Since build times can be lengthy, it’s common to use Dev
into modules Apps to test and develop each individual module. However, to
understand how each module works together, they eventually
need to be tested and released together. Therefore, intrateam
communication needs to be solid with every release. Overall
this could help scale the number of teams but at the cost of
developer efficiency.
Within Android you can use the App Bundle feature called
Dynamic Feature Modules. This feature allows you to
dynamically download specific feature modules rather than the
entire application, reducing the install size of the application and
improving delivery. However, Dynamic Feature Modules lack
the same speed of delivery that we gain with micro frontends.
These feature modules are also developed in the same way
and coordination difficulties are still prominent. Additionally,
development teams cannot independently update and deliver
the code within these features modules.
Considerations
when adopting
a micro frontend
architecture
While there are many benefits to using a micro frontend
architecture in large-scale enterprise applications, there are
some organizational and structural questions to consider. Is
the team big enough to make micro frontend architecture
worth pursuing? Do the projects have enough resources?
Are micro frontends just a trend? The following section will
break down what to know before making the decision to
change your application development strategy.
Organizational considerations for a
micro frontend architecture
Though implementing a micro frontend architecture is considered a technical decision, it is just as
much a team and organizational decision.
Team coordination
How is your team structured today? Teams must first be broken into feature teams, each
handling a small section of the application. This requires coordination across many parts of the
organization to ensure there are no duplicate efforts or overlaps in project tasks. Dependencies
between teams also need to be thought through. Each team manages their own feature, but
together, these features need to function as a single application.
Come up with a strategy to determine which teams work on which features, how these features
will work together, what component libraries and design systems will be adopted, and what
languages will be used across each micro frontend. With these structural decisions made, the
project can run smoothly.
Here are two guidelines we recommend when breaking up an existing application that is currently
supported by a single team:
1. Organize the teams based on the expertise/skill sets of the individual members
2. Clearly define the functionality and areas of responsibility for each team
Collaboration
Understand that even though you have separate
teams and clear responsibilities, there will still need
to be collaboration across teams. Ensuring that
common functionality is implemented in accessible
ways and dependencies are properly managed are
critical for long term success.
Module Federation
The most common tool used today for web based micro frontends is Module Federation.
This allows applications to create contracts between micro frontends, the single-page
application (SPA) that they are used within, and the dependencies that they may share.
As long as the contract stays consistent and is not broken, each individual piece can be
updated and deployed independently.
This works best when all the applications share common functionality and use the same
JavaScript framework, such as Angular or React. By allowing Module Federation to
coordinate the dependencies at runtime you can maximize speed and reduce duplication
of code.
Federated Capacitor
Federated Capacitor is a tool that allows for Over-the-Air (OTA) updates of both the shell
application and of each individual micro-frontend. When Federated Capacitor is used in
conjunction with micro frontend tools like Module Federation and single-spa you regain
the advantage of independent releases of micro frontends in web native applications.
This works best when you are optimizing for independence of developer teams
and allowing them to choose their own technology. However, this comes with the
downsides of increased lines of code, a larger surface area to maintain, and
potentially slower applications.
Setting boundaries
There are quite a few advantages to using micro frontends in web native applications.
With all the code running on the same web platform, you gain flexibility in how to
coordinate the primary application and all of the micro frontends that it includes. You can
introduce them as multiple views, single components, or even widgets.
You can also adapt your existing testing procedures of web native to cover the micro
frontends and the primary application. Commonly, you’d have a series of end-to-end tests
that cover the entire experience or integration points from the primary application team’s
perspective. However, allowing micro frontends teams to have their own test suites works
as well.
If you’re considering adopting a micro frontend strategy in a single platform (like web
native), you must be explicitly clear about the boundaries between your teams. Team
members should understand which responsibilities are theirs to ensure seamless
collaboration. You must also be clear on when code sharing is acceptable versus not.
While micro frontends make code sharing easier than ever, sharing code introduces
new potential risks that your team should be aware of.
Portals is a tool that allows you to integrate views into a native mobile app using web
technologies like HTML, CSS, and JavaScript. This means that you can use Portals to create
web-based micro frontends and seamlessly integrate them into your native mobile app. By
using enhanced Web Views, Portals allows you to communicate between the native app and
the web content for data exchange and event handling.
These micro frontends are located on the mobile device, not remotely on a server, and create a
seamless user experience. Each Portal can be remotely configured with OTA updates allowing
for autonomous and independent development and deployment. Micro frontend teams aren’t
required to coordinate a larger release of the native application, saving time and resources.
Considerations
When introducing micro frontends into a native application, the primary consideration is usually
how it might affect the user experience. The coordination of multiple teams with different
technology platforms can add to this complexity. Thinking about the micro frontends as clearly
defined features of a larger native application creates guardrails:
• Is the feature a core element of the application? Then you might make it the entire
context of a tab stack.
Because the micro frontends themselves are built with the web, it makes the most sense
to allow each individual team to write their own end-to-end tests to cover their respective
features. Then, focus on simply testing the integration points between the native application
and the web-based micro frontend experiences to ensure your app is ready to go.
But there are some disadvantages as well (and the benefits above could come at a cost).
Web Views provided by Apple and Google, can ultimately negatively impact customer experience
because of how difficult they are to implement. Creating a seamless experience between the native
app and Web Views are extremely important, and stock Web Views are simply lacking.
Take authentication, for example. In order to log into an account on the native layer then jump to the
Web View to see the profile, the system will need to pass that authentication token over to the Web
View in order to provide a seamless experience. This kind of communication bridge needs to
be created by your development team.
To truly make use of these micro frontends in multiple operating systems, this code needs to be
replicated on iOS and Android. Developers must also learn two different APIs on two different
operating systems—iOS WKWebView and Android WebView.
The biggest issue with Web Views is perception and consumer experience. It’s common for
the web features to feel like they don’t belong in the rest of the native application, requiring
network requests to load web code creates a subpar user experience when compared to the
rest of the application.
Because micro frontends are built using web technologies, native teams can work on
important native features while web teams can tackle the web-based features. That
way each team handles their own codebases and plays to their strengths.
Portals fully supports any stack with JavaScript compatibility, which makes building
with it future-proof. With access to a large library of core plugins and over 5 million web
developers using and contributing to community plugins, developers can find exactly
what they need to build the best mobile applications using Portals.
With automated caching and delivery, features can be tested and, if necessary, rolled
back instantly. Furthermore, fixes can be deployed instantly to provide a seamless and
bug-free customer experience.
23 / 27
2. Securely maintain core features when involving
different teams.
Parallel app development seems like the right solution for shipping apps and features faster,
but what about security? Can web and native development accidentally overstep and cause
greater issues when working on various code bases at once?
With micro frontends, mobile native teams can grant multiple internal teams permission to
safely and securely contribute to different parts of the app. Limits can be placed on what the
web team can access, giving them a sandbox-like experience without the risk of breaking the
native functionality or introducing security risks.
24 / 27
3. Reuse microapps across multiple applications.
Micro frontend architecture not only allows for parallel development across web and native
mobile teams, but it enables reuse of web content across multiple platforms.
Web teams developing common experiences like chat functionality, shopping cart checkout,
and standard copy like FAQs or legal boilerplate text can reuse experiences across various
platforms, rather than just on the web. That means faster time-to-market by eliminating the
need to recreate web experiences for each device. It also means less resources are used
rewriting code and re-building features that already exist elsewhere.
Reusing content also ensures standardization among different teams for continuity and feature
parity. This ultimately leads to a seamless and trusted customer experience.
Additionally, beyond reusing content on native applications, this functionality can expand to
smart TVs, refrigerators, car systems, and other platforms.
25 / 27
Summary
If you have a large team working on a sizable app, then micro frontends may be
for you. Micro frontend architecture enables teams to work in parallel and reuse
features that have already been built in their web or native applications. That
means that applications can be built and updated faster than ever, while using
less resources and still providing a great user experience.
If you’re considering micro frontends for your native and React Native
applications, then Ionic Portals is a great solution. It empowers your team to
work together efficiently, while ultimately putting out a better product faster
than ever.
For general questions,
comments, or feedback,
please contact demo@ionic.io.
@ionicframework
LinkedIn