Skip to main content
XenonStack

Data Visualization

XenonStack Blog Micro Frontends with JavaScript Frameworks: Guide

| Published | Updated

Key takeaway

  • Micro frontends let teams build and release parts of one web app on their own. See integration options, web components and rules for mixing JS frameworks.

A micro frontend is an independently deliverable frontend application that is composed with others into one larger web application, so that separate teams can build, test and release their own part of the interface. Martin Fowler's micro frontends article defines the style as independently deliverable frontend applications composed into a greater whole, and notes that the Thoughtworks Technology Radar first listed it in November 2016.

This guide is for frontend leads and architects who run several teams on one product and want to know how to combine JavaScript frameworks such as Angular, React and Vue on one page. It covers the integration options, how web components fit, the rules that keep fragments apart, and when not to use the approach. For the architecture view, read our guide to micro frontend architecture.

What is a micro frontend and what problem does it solve?

Many companies split their backend into microservices and leave the frontend as one large application. Over time that frontend, often built by several teams, becomes hard to change: a small edit means a full build and a coordinated release. The article presents micro frontends as the answer, with smaller and more cohesive codebases, incremental upgrades and rewrites, and independent deployment, each micro frontend having its own delivery pipeline.

The key design choice is how to slice. The article recommends teams formed around vertical slices of business functionality, with each micro frontend owned end to end by one team, rather than teams split by technical layer. That mirrors the thinking in microservices testing strategies, where each service is owned and verified on its own.

How do you integrate micro frontends on one page?

Something has to assemble the fragments. Fowler's article describes five approaches.

ApproachHow it worksPoint to note
Server-side template compositionFragments are assembled on the server, for example with server-side includesWorks with plain HTML; composition happens before the browser
Build-time integrationEach micro frontend is published as a package and bundled by a containerThe article warns it creates a lockstep release process
Run-time via iframesEach fragment sits in its own frameEasy isolation, but routing, deep linking and responsiveness get harder
Run-time via JavaScriptEach bundle exposes a global function as its entry point that the container calls to mount and unmount itThe article's default choice
Run-time via web componentsEach micro frontend defines a custom element that the container createsSuits teams that want to rely on browser standards

This is where mixed frameworks come in. With run-time integration, the container does not care whether a fragment is built with Angular, React, Vue or plain JavaScript, as long as it honours the mount and unmount contract or the custom element contract. Agree that contract first, because it is the public interface between teams.

How do web components help micro frontends?

The MDN web components guide names three main technologies, and each maps to a micro frontend need.

TechnologyWhat MDN says it doesWhy it helps
Custom elementsJavaScript APIs to define custom elements and their behaviour for use in your interfaceA named tag becomes the contract between teams
Shadow DOMAttaches an encapsulated tree to an element so its styles and IDs do not collide with the rest of the documentKeeps one team's styles from leaking into another's
HTML templatesThe template and slot elements define reusable markup that is not displayed until usedReusable structure inside a custom element

The article notes that the web components route suits teams that want to rely on browser standards, which keeps the contract independent of any one framework.

What rules keep micro frontends from colliding?

Teams ship on their own schedule, so shared assumptions are the main risk. The article gives clear guidance.

Two-column diagram. Build side: server-side includes, build-time packages, team ownership, naming rules. Run side: iframes, JavaScript mount, web components, Shadow DOM.
  • Keep communication between fragments minimal, using custom events, data passed from parent to child, or URL routing, and avoid having any shared state.
  • Treat CSS as global by default. Use a strict naming convention such as BEM, preprocessor nesting, CSS modules or CSS-in-JS, or Shadow DOM for style isolation.
  • Prefix or namespace anything global, such as events, storage keys and cookies, so ownership is obvious.

Each of these rules reduces the chance that one release breaks another. For the deployment side of independent pipelines, see our guide to deploying Java microservices on Kubernetes.

When should you not use micro frontends?

Micro frontends add moving parts: a container, a contract for each fragment, and several build pipelines. If one small team owns a modest application, a single well-structured codebase is usually simpler. The approach pays back when several teams, organised by business domain, need to release independently. That is a judgement call for your organisation, so start with one boundary and measure how much release friction it removes. Visual components such as charts can stay inside one fragment; our guide to the D3.js library and its use cases shows one example, and capsule networks is a separate topic if you are exploring other kinds of component design.

How do AI agents change micro frontend work?

Agents can take over repetitive checks across many small codebases: reviewing a fragment against its mount contract, flagging global CSS or shared state, drafting boundary tests and summarising pipeline failures. People should still own the slicing decisions and the contract between teams. For agent, testing and automation work of this kind, see ElixirClaw, the AI agents computing platform.

What should you do first?

  1. Map your pages to business domains and mark where two teams change the same code.
  2. Choose one boundary, such as checkout or search, as the first fragment.
  3. Pick an integration approach from the table and write the contract: entry point or element name, events and URL rules.
  4. Agree naming and styling rules before the second fragment exists.
  5. Give each fragment its own pipeline and tests, and track release lead time.

Is there a video on micro frontends?

A short video is embedded below.

 

To map one decision your agents make across frontend and backend services, and the data and policy it depends on, book a Context Workshop. See what happens in the workshop.

Frequently asked questions

What are micro frontends?

Micro frontends are an architectural style where independently deliverable frontend applications are composed into a greater whole. Each is owned by one team and can be built, tested and deployed on its own.

Can I mix Angular, React and Vue in one application?

Yes, with run-time integration the container mounts each fragment through an agreed entry point or custom element, so the fragments can use different frameworks. Agree the contract and the rules for shared state and styles first.

How do web components relate to micro frontends?

Web components are one way to integrate them. A micro frontend defines a custom element, and Shadow DOM keeps its styles and IDs from colliding with the rest of the page.

Is build-time integration a good idea?

Fowler's article warns against it, because publishing each micro frontend as a package for a container to bundle creates a lockstep release process.

When is a micro frontend not worth it?

When one small team owns a modest application, a single codebase is usually simpler. The approach pays back when several teams organised by business domain need to release independently.

Follow XenonStack on LinkedIn: XenonStack on LinkedIn for new guides on agentic AI, data and platform engineering.

Ready to put AI agents to work? Explore ElixirClaw, the agentic OS platform to build, orchestrate and govern AI agents.

Table of Contents

navdeep-singh-gill

Navdeep Singh Gill

Global CEO and Founder of XenonStack

LinkedIn profile

Navdeep Singh Gill is serving as Chief Executive Officer and Product Architect at XenonStack. He holds expertise in building SaaS Platform for Decentralised Big Data management and Governance, AI Marketplace for Operationalising and Scaling. His incredible experience in AI Technologies and Big Data Engineering thrills him to write about different use cases and its approach to solutions.

Get the latest articles in your inbox

Subscribe Now

Interested in solving your challenges with the XenonStack team?
Get Started

Tell us about you and your priorities so we can prepare the right conversation. It takes about 2 minutes.

Please Select your Industry
Banking
Fintech
Payment Providers
Wealth Management
Discrete Manufacturing
Semiconductor
Machinery Manufacturing / Automation
Appliances / Electrical / Electronics
Elevator Manufacturing
Defense & Space Manufacturing
Computers & Electronics / Industrial Machinery
Motor Vehicle Manufacturing
Food and Beverages
Distillery & Wines
Beverages
Shipping
Logistics
Mobility (EV / Public Transport)
Energy & Utilities
Hospitality
Digital Gaming Platforms
SportsTech with AI
Public Safety - Explosives
Public Safety - Firefighting
Public Safety - Surveillance
Public Safety - Others
Media Platforms
City Operations
Airlines & Aviation
Defense Warfare & Drones
Robotics Engineering
Drones Manufacturing
AI Labs for Colleges
AI MSP / Quantum / AGI Institutes
Retail Apparel and Fashion

Continue