Using ES Modules Based Micro-Frontends to Enable Distributed Development

Rate this content
Bookmark

A look at the open source tooling created by the UI Engineering group at JP Morgan to streamline the developer workflow of building and deploying apps in isolation while still delivering a single unifying micro-frontend based portal to the end user, leveraging the use of native support for ES module imports in the browser.

This talk has been presented at React Advanced Conference 2022, check out the latest edition of this React Conference.

FAQ

The UITK, or User Interface Toolkit, is a React component library used at JPMorgan to standardize the appearance and interaction of their applications, ensuring a consistent look and feel across different platforms.

Modular is an opinionated monorepo management tool used at JPMorgan to streamline and manage the development process of multiple projects within a single repository. It helps in scaffolding new applications and standardizing configurations across projects.

JPMorgan deploys multiple applications by using a desktop container and web portal that allows applications to be launched in a consistent manner. They use modern web technologies like ES modules for dynamic loading and sharing of CSS theming across applications.

The main challenges include managing a large number of development teams that work independently, ensuring consistent application quality, integration, and deployment processes across different teams, and maintaining a uniform design language and user experience.

JPMorgan uses continuous integration and deployment strategies, along with a centralized design system and component libraries like UITK. They also provide a digital platform with DevOps tools and services that standardize testing, deployment, and quality assurance processes.

JPMorgan's digital platform utilizes technologies such as Jenkins for continuous integration, Amazon S3 for continuous deployment, and a centralized application registry to manage code versions and rollbacks. They also use modern web components and focus on React for UI development.

JPMorgan manages micro frontends by using ES modules for dynamic application loading and splitting. This approach allows for efficient dependency management and faster loading times, leveraging modern browser capabilities to support dynamic imports without plugins.

Steve King
Steve King
28 min
21 Oct, 2022

Comments

Sign in or register to post your comment.

Video Summary and Transcription

JP Morgan is using modern web technologies like the UITK and Modular to address challenges in their large-scale development environment. They employ micro front-ends with ES modules for dynamic loading and sharing theming using CSS variables. The applications are built using modular, which allows for scaffolding and creating new applications from templates. They rely on an opinionated approach to app creation and use a CDN for efficient deployment and caching. The host application handles user authentication and communication between micro front-ends, while platform services like authorization and authentication are provided by the digital platform.

1. Introduction to JP Morgan's Web Technologies

Short description:

My name is Steve and I'm here to talk about how we're using modern web technologies at JP Morgan. We have two things to discuss: the UITK, a React component library, and Modular, an opinionated monorepo management tool. We have a large-scale development environment with thousands of applications and developers. Each development team faces the same challenges of continuous integration, continuous deployment, and quality assurance.

Good morning everyone. With that amount of videos about JPMorgan, no pressure doing this today. So, as I said, my name is Steve, and I'm here to talk a little bit about how we're using modern web technologies, JP, things like ES modules where we can use them to solve age-old problems, problems like how do we run multiple applications that have all been built and deployed independently of each other in single container portal-like applications.

So a little bit about me. I've been working in and around the fintech space for about 20 years now, and I've had the privilege to see UI technologies grow during that time. And now that I'm with JP Morgan, I'm actually no longer a core developer. But now I get to work with developers to put together our open source providing. We have two things I'm going to talk about today. One is the UITK, which is a React component library that we use to standardize the way their applications look and feel. And Modular, which is an opinionated monorepo management tool. And they're actually both on our public Github, if you want to check them out. And we have we appreciate pull requests.

So the kind of places I've worked at before, I said it's always in Fintech. Some of those organizations are really small. When I came to JP Morgan last year, I had no real idea of a sense of scale that I was going to be facing. We have across the bank as a whole is 50,000 developers, I think. 18,000 of which are in our division. And we're deploying about 5,800 applications into one of our container types, which is a desktop container. 2,000 of those are in production. They service about 200,000 daily users. There are hundreds of deployments going on every day. We have this really distributed development problem. Or joy, depending on how you look at it. Distributed development means we have loads of development teams. They all work independently. They're empowered to make their own choices about how they're going to build their applications, how they're going to deploy them, and more recently, how often do they deploy? Why are they actually sending code out? But looking at it from an organizational standpoint, what is the developer experience of that distributed development model? Well, every development team has to solve the same problems. They're all going to need to have some form of continuous integration. They're all going to need continuous deployment, and they're all going to have the same need to apply quality assurance. So they're going to need test tooling. They're going to need to choose the same products for doing their testing.

2. Consistency and Solutions in UI Engineering

Short description:

And then because we're all under the same brand umbrella, we're going to need to have the same design language. So what was our solution to that? So our solution is in UI engineering. We have what we call the Digital Platform, which is a bit like a Jamstack provider inside the bank. We have a design system that is an accessibility first design system that has a companion react-based component library. We have a new version of the React library being developed at the moment. And more finally, the modular, which is an opinionated monorepo management tool. It has a few features in it that I'll be showing today, but it's similar to create-react-app and then an opinionation on developer tooling that goes in with building the applications themselves. So we have a desktop container. When we come to deliver a web portal, users still want to have a single way of launching applications. They want to have a consistent look and feel on the apps that they're loading, and they want to be able to use their apps in all modern browsers.

And then because we're all under the same brand umbrella, we're going to need to have the same design language. So how do we add that consistency to the applications that we're deploying? Bearing in mind, there's thousands of them being pushed out. So when the applications go out as well, they're going to need to solve the same kind of problems. We need to know how they're going to authenticate their users, how they authorize them to use the apps. And because we want to have the same rich user experiences, we're thinking how are you going to be able to share the layouts you've created, how you're going to share access to your applications. Which all kind of implies that you've got the same kind of understanding of having a preferences system. How you're going to store and persist the user data.

So what was our solution to that? So our solution is in UI engineering. We have what we call the Digital Platform, which is a bit like a Jamstack provider inside the bank. So I've already mentioned we have a desktop container, but we have ways that we distribute our mobile and web apps as well. We call it Omnichannel, but we also provide more of a DevOps providing. So we have things like continuous integration, actually it's based on Jenkins. We have continuous deployment which is based on Amazon S3. And we also provide like a centralized application registry and that's where we have our developers push the versions of their code so we can determine which are going to be made available in production. And more importantly, when we need to roll things back, it simplifies our processes. And then probably more relevant to today and what I'm going to be talking about later is we have a design system. So that is actually, it's an accessibility first design system that has a companion react-based component library. We have been embracing web components and allowed for the use of Angular. There was a decision made a couple of years ago that we were going to be react focused. So we actually have a new version of the React library being developed at the moment. It will be released fairly soon. Feel free to go and have a look at it on our GitHub. And then more finally, the modular, which is an opinionated monorepo management tool. It has a few features in it that I'll be showing today, but it's similar to create-react-app and then an opinionation on developer tooling that goes in with building the applications themselves.

So we have a desktop container. The developers, when they create applications, push it through to our continuous deployment infrastructure, and tell the desktop container, which is an Electron-based app, where to fetch the URLs. When we come to deliver a web portal, what is the user experience expectation? It's actually it's almost the same as on desktop. Users still want to have a single way of launching applications. They want to have a consistent look and feel on the apps that they're loading, and they want to be able to use their apps in all modern browsers. So historically, that could have meant using iframes to load applications together, which would come with the usual drawbacks of you've got many, potentially many, instances of frameworks being loaded into one application, into one web browser window.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Scaling Up with Remix and Micro Frontends
Remix Conf Europe 2022Remix Conf Europe 2022
23 min
Scaling Up with Remix and Micro Frontends
Top Content
This talk discusses the usage of Microfrontends in Remix and introduces the Tiny Frontend library. Kazoo, a used car buying platform, follows a domain-driven design approach and encountered issues with granular slicing. Tiny Frontend aims to solve the slicing problem and promotes type safety and compatibility of shared dependencies. The speaker demonstrates how Tiny Frontend works with server-side rendering and how Remix can consume and update components without redeploying the app. The talk also explores the usage of micro frontends and the future support for Webpack Module Federation in Remix.
Monolith to Micro-Frontends
React Advanced Conference 2022React Advanced Conference 2022
22 min
Monolith to Micro-Frontends
Top Content
Microfrontends are considered as a solution to the problems of exponential growth, code duplication, and unclear ownership in older applications. Transitioning from a monolith to microfrontends involves decoupling the system and exploring options like a modular monolith. Microfrontends enable independent deployments and runtime composition, but there is a discussion about the alternative of keeping an integrated application composed at runtime. Choosing a composition model and a router are crucial decisions in the technical plan. The Strangler pattern and the reverse Strangler pattern are used to gradually replace parts of the monolith with the new application.
Micro-Frontends With React & Vite Module Federation
React Advanced Conference 2023React Advanced Conference 2023
20 min
Micro-Frontends With React & Vite Module Federation
Top Content
Watch video: Micro-Frontends With React & Vite Module Federation
Microfrontends is an architecture used by big companies to split monolithic frontend applications into manageable parts. Maintaining a consistent look and feel across different microfrontends is a challenge. Sharing styles can be done through Vanilla CSS, CSS modules, or CSS in JS. JavaScript variables can be used in styles, but readability and runtime overhead are considerations. Sharing state in microfrontends can be achieved through custom events, broadcast channels, shared state managers, or custom PubSub implementations. Module federation with Vite allows for client composition and sharing dependencies. Configuration is similar to Webpack, and future work includes working on the QUIC framework.
Federated Microfrontends at Scale
React Summit 2023React Summit 2023
31 min
Federated Microfrontends at Scale
Top Content
Watch video: Federated Microfrontends at Scale
This Talk discusses the transition from a PHP monolith to a federated micro-frontend setup at Personio. They implemented orchestration and federation using Next.js as a module host and router. The use of federated modules and the integration library allowed for a single runtime while building and deploying independently. The Talk also highlights the importance of early adopters and the challenges of building an internal open source system.
“Microfrontends” for Mobile in React Native
React Advanced Conference 2023React Advanced Conference 2023
24 min
“Microfrontends” for Mobile in React Native
Top Content
Watch video: “Microfrontends” for Mobile in React Native
Micro frontends are an architectural style where independent deliverable frontend applications compose a greater application. They allow for independent development and deployment, breaking down teams into feature verticals. React Native's architecture enables updating the JavaScript layer without going through the app store. Code Push can be used to deploy separate JavaScript bundles for each micro frontend. However, there are challenges with managing native code and dependencies in a micro frontend ecosystem for mobile apps.
Sharing is Caring: (How) Should Micro Frontends Share State?
React Summit 2022React Summit 2022
23 min
Sharing is Caring: (How) Should Micro Frontends Share State?
Top Content
Micro-frontends allow development teams to work autonomously and with less friction and limitations. Organizing teams around business concerns, in alignment with subdomains, rather than technical concerns, can lead to software that is split nicely and user stories falling under the responsibility of a single team. Having a logical backup or reference point is important for implementing microfrontends without breaking their isolation. Microfrontends can communicate with each other using the window object and custom events. Microfrontends should be kept isolated while maintaining communication through various approaches.

Workshops on related topic

Micro Frontends with Module Federation and React
JSNation Live 2021JSNation Live 2021
113 min
Micro Frontends with Module Federation and React
Workshop
Alex Lobera
Alex Lobera
Did you ever work in a monolithic Next.js app? I did and scaling a large React app so that many teams can work simultaneously is not easy. With micro frontends you can break up a frontend monolith into smaller pieces so that each team can build and deploy independently. In this workshop you'll learn how to build large React apps that scale using micro frontends.
Micro-Frontends with Module Federation and Angular
JSNation Live 2021JSNation Live 2021
113 min
Micro-Frontends with Module Federation and Angular
Workshop
Manfred Steyer
Manfred Steyer
Ever more companies are choosing Micro-Frontends. However, they are anything but easy to implement. Fortunately, Module Federation introduced with webpack 5 has initiated a crucial change of direction.
In this interactive workshop, you will learn from Manfred Steyer -- Angular GDE and Trusted Collaborator in the Angular team -- how to plan and implement Micro-Frontend architectures with Angular and the brand new webpack Module Federation. We talk about sharing libraries and advanced concepts like dealing with version mismatches, dynamic Module Federation, and integration into monorepos.
After the individual exercises, you will have a case study you can use as a template for your projects. This workshop helps you evaluate the individual options for your projects.
Prerequisites:You should have some experience with Angular.