惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
V
Vulnerabilities – Threatpost
Attack and Defense Labs
Attack and Defense Labs
N
News and Events Feed by Topic
SecWiki News
SecWiki News
S
Security @ Cisco Blogs
Schneier on Security
Schneier on Security
B
Blog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
H
Hacker News: Front Page
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园_首页
D
Docker
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Y
Y Combinator Blog
W
WeLiveSecurity
N
News and Events Feed by Topic
F
Fortinet All Blogs
PCI Perspectives
PCI Perspectives
WordPress大学
WordPress大学
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Recent Announcements
Recent Announcements
Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
Hacker News: Ask HN
Hacker News: Ask HN
爱范儿
爱范儿
腾讯CDC
Last Week in AI
Last Week in AI
月光博客
月光博客
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
Help Net Security
Help Net Security
V
V2EX
C
Cyber Attacks, Cyber Crime and Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
H
Heimdal Security Blog
L
LINUX DO - 最新话题
GbyAI
GbyAI
The Hacker News
The Hacker News
罗磊的独立博客
S
SegmentFault 最新的问题
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 【当耐特】
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
V2EX - 技术
V2EX - 技术
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
O
OpenAI News
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

Inside Nutrient

A guide to the invisible work behind documents Introducing Nutrient Documents for Salesforce: Native document generation and signing Document AI vs. traditional OCR: Choosing between OCR, AI, and hybrid pipelines PDF SDK compliance and security evaluation checklist for enterprise teams (2026) Invariant Corp replaces paper processes with Nutrient Workflow and scales without limits What is process mapping? A complete guide Nutrient vs. Conga Composer for Salesforce document generation (2026) Document routing: How to automate document distribution The CTO’s AI playbook: Why accountability architecture beats orchestration Compliance workflow automation: Why built-in compliance is table stakes Workflow diagrams: Examples, symbols, and how to build one that actually runs Digital forms: Replace paper forms with automated workflows Approval workflow software: How to automate approvals Why document-centric automation is different The CEO’s AI playbook: Why decision architecture beats model selection Nutrient SDK product updates for Q1 2026 PDF redaction verification: How to prove sensitive data is permanently removed What is a VPAT? The complete guide to accessibility conformance reports What is PDF/UA? The accessible PDF standard explained Salesforce eSignatures: Generate, sign, and track documents in one flow Online document viewer: Options, tradeoffs, and how to embed one Document viewer for web apps: React, Vue, Angular (2026) Best document viewers in 2026: A buyer’s guide How to edit a PDF in Python: Add text, images, and annotations Nutrient advances Workflow platform with agentic AI for enterprise-grade speed and consistency in document-heavy operations How to create a Salesforce quote template from opportunity data The business case for accessibility: Five ways it drives enterprise value Python PDF library comparison (2026): 7 libraries for developers Why your AI agent hallucinates PDF table data PDF.js limitations: When to upgrade to a commercial PDF SDK How Subject scaled 5× with Nutrient’s PDF SDK without rebuilding its document layer I replaced our sales training with an AI coach that runs in Slack — here’s what broke Redirecting to: https://securitybuzz.com/cybersecurity-news/why-enterprise-permissions-are-ais-most-dangerous-inheritance/ Nutrient .NET SDK vs. iText Core: Complete comparison for .NET developers DocuVieware: Support’s most frequently asked setup questions Introducing Nutrient Workflow How to convert PDF to Word in C# (.NET) When email and spreadsheets stop working: Work order approval workflows for field teams on the move Compliance with confidence: Why document-centric automation is the foundation of your mission Nutrient expands AI Assistant, automating multistep document workflows inside any application What is document generation? A developer’s guide to PDF generation Document Converter data flow and how real-time watermarks skip the queue PDF/UA compliance guide: Requirements, standards, and best practices Computers still can’t understand you How Athena Intelligence built AI agents for regulated enterprises with Nutrient’s document infrastructure How to convert HTML to PDF (2026): 4 methods from browser print to SDK How to build a document extraction pipeline with Nutrient Vision API OCR vs. intelligent document processing: Choosing the right document extraction engine Beyond OCR: How document intelligence eliminates manual processing in regulated industries Nutrient vs. IronPDF: Complete comparison for .NET developers Nutrient vs. Aspose.PDF: Complete comparison for .NET developers Redirecting to: https://fortune.com/2026/02/19/openclaw-who-is-peter-steinberger-openai-sam-altman-anthropic-moltbook/ Lufthansa Systems uses Nutrient to deliver reliable, scalable PDF rendering for pilots worldwide Nutrient vs. Syncfusion: Complete comparison for .NET developers React’s useTransition: The hook you’re probably using wrong First City Monument Bank streamlines banking processes with Nutrient Workflow Redirecting to: https://www.sdcexec.com/warehousing/automation/article/22957364/nutrient-workflow-automation-the-missing-link-in-supply-chain-efficiency The complete guide to digital signatures: PAdES, CAdES, and XAdES explained Nutrient Python SDK: Production-grade document processing for Python Introducing agentic document editing for web applications with AI Assistant Nutrient vs. QuestPDF: Complete comparison for .NET developers How we fixed the GdPicture license expiration (and what to do if you’re affected) Red team security testing with agentic AI The future of healthcare document automation Best healthcare workflow software compared Nutrient SDK product updates for Q4 2025 How Harvey scaled legal document workflows 50 percent MoM without rebuilding infrastructure HIPAA-compliant document management in hospitals How we optimized rendering performance while handling thousands of annotations in React — Part 2 Automated PII removal with Nutrient API Redirecting to: https://www.devopsdigest.com/2026-low-code-no-code-predictions Redirecting to: https://www.kmworld.com/Articles/Editorial/ViewPoints/Leaders-predict-AI-to-continue-permeating-all-aspects-of-KM-in-2026-172594.aspx What are deep agents and how do they solve complex problems? Whipping up document magic: Your easy-bake recipe for Vue and Nutrient Web SDK 🧁 What I’ve learned about product iteration planning while building SDKs Passwordless document signing: Three-layer security guide New zip folder functionality streamlines file management in Document Automation Server The keyboard shortcuts playbook: Taking control of keyboard events in Nutrient Web SDK From experienced engineer to AI beginner: My unexpected journey AI-assisted manual testing: Handling Safari’s PDF rendering and UI quirks How to keep a 20-year-old SDK up to date How we optimized rendering performance while handling thousands of annotations in React — Part 1 Nutrient announces new executive hires to accelerate next phase of growth High performance UI using web workers Automate document conversion at scale with Python and Nutrient DCS From curiosity to PLG (and AI): My journey to understanding product-led growth Prost to progress: One year as Nutrient Pigeon usage at Nutrient: Bridging native SDKs to Flutter Modernizing CI build servers: How to migrate from Chef to Ansible Unix man pages: AI-friendly documentation since 1971 Consistent hashing for even load distribution Best AI redaction APIs: Complete comparison guide for 2025 Why AI document redaction matters for modern security From coding to coordinating: How AI transformed my workflow What is intelligent document processing (IDP)? A complete guide Enterprise PDF SDKs: Best PSPDFKit (now Nutrient) alternatives Nutrient SDK product updates for Q3 2025 GdPicture support best practices Redacting sensitive data with Nutrient AI redaction API How AI is transforming the customer experience at Nutrient: From instant answers to intelligent support
Practical micro frontends: How we orchestrated multiple frameworks with single-spa
Michael Del Regno · 2025-10-21 · via Inside Nutrient

If you’ve ever tried to implement micro frontends in production, you know the frustration. The promise is beautiful: independent teams, independent deployments, technology freedom, scaling nirvana.

The reality is often more complex: duplicate dependencies bloat bundle sizes, routing conflicts emerge between applications, and teams find themselves needing more coordination than expected for seemingly simple changes.

At Nutrient, we’ve learned that micro frontends can work well when implemented thoughtfully. Our production system — which manages multiple applications across different frameworks — is proof of that. In this post, you’ll learn what we discovered about making this architecture practical.

TL;DR

  • Many micro frontend implementations introduce complexity without clear benefits.
  • Our production single-spa system manages multiple frameworks with practical architecture patterns that reduce common pitfalls.
  • This post includes tested tutorial code and outlines migration strategies for moving from a monolith to micro frontends.

Common micro frontend challenges

While micro frontends promise independent teams, faster deployments, and technology flexibility, in practice, they introduce new complexities. From our experience, most teams run into four recurring problem areas.

Dependency multiplication issues

When multiple micro frontends are developed independently, it’s easy to accidentally bundle the same library multiple times. Each application may include its own version of React, Vue, or other shared dependencies, often with slight version differences:

// App 1: React 18.2.0 (bundled) — 1.2MB

// App 2: React 18.1.0 (bundled) — 1.2MB

// App 3: React 17.0.0 (bundled) — 1.1MB

// Result: 3.5MB of React code for "micro" frontends

This usually happens because each app is bundled independently, dependencies are imported directly instead of being shared, and teams aren’t aligned on library versions. The result is larger bundles, slower load times, and “micro” frontends that aren’t actually lean. Single-spa solves this with shared dependencies and import maps, ensuring libraries are loaded once across all applications.

The routing war zone

Routing conflicts quickly emerge when different applications try to control the URL. Vue Router and React Router can fight for control, hash-based vs. browser routing can collide, and deep linking can break when switching between apps.

These conflicts make navigation unpredictable and create maintenance headaches. With single-spa, each application is assigned a clear URL scope using route-based activation, so only the relevant app responds to a given path, preventing clashes and keeping user navigation smooth.

The shared state chaos

State management across multiple micro frontends is another common pain point. Authentication can be scattered, user contexts can diverge, and event communication patterns that work for two apps collapse at scale. Session handling effectively becomes a distributed systems problem.

Without a well-defined shared state strategy, teams spend more time debugging inconsistencies than building features. Our approach uses shared libraries for authentication, user context, and core services, giving a single source of truth while preserving application independence.

The development coordination tax

Finally, “micro” teams often face significant coordination overhead. Releases require careful synchronization, build pipelines become complex, local development is difficult to configure, and integration testing grows exponentially harder as the number of apps increases.

We address this with orchestrated workflows and startup scripts that allow developers to run all micro frontends locally with minimal setup. Combined with selective builds and hot reload across frameworks, teams can work independently without being slowed down by excessive coordination.

Note: Poorly implemented micro frontends can significantly increase development overhead compared to well-architected monoliths.

Our architecture approach with single-spa

Instead of accepting these problems as inevitable, we built an architecture that addresses many of these challenges. Our production system manages multiple independent applications with different technology stacks in a more coordinated way.

The foundation: Module federation patterns

The core insight is that micro frontends aren’t just about splitting code — they’re about creating a sustainable development ecosystem. Our approach centers on three key patterns.

Consistent development environment

// Development import map with localhost URLs.

const developmentImportMap = {

"@site/shared-lib": "http://localhost:3001/shared-lib.js",

"@site/app-a": "http://localhost:3002/app-a.js",

"@site/app-b": "http://localhost:3003/app-b.js",

"@site/legacy-app": "http://localhost:3010/legacy-app.js",

};

// Production uses versioned CDN URLs:

const productionImportMap = {

"@site/shared-lib": "https://cdn.example.com/v1.2.3/shared-lib.js",

"@site/app-a": "https://cdn.example.com/v1.2.3/app-a.js",

};

Hybrid loading strategy for the real world

function registerApp(appName, customProps = {}) {

singleSpa.registerApplication({

name: appName,

app: () => import(`@site/${appName}`),

activeWhen: routeMatchers[appName],

customProps,

});

}

A practical shared dependency approach

// External dependencies prevent duplication.

const externals = [

/^@site\/*/, // Site modules are external.

"vue",

"vue-router",

"vuex", // Vue ecosystem.

"react",

"react-dom",

"react-router-dom", // React ecosystem.

];

// Result:

// - Vue.js loaded once, shared by multiple applications.

// - React loaded once, shared by modern apps.

// - Significantly reduced bundle duplication.

Route-based activation that prevents chaos

In a micro frontend system, it’s critical that each application only responds to the URLs it owns. Without clear boundaries, multiple apps can compete for the same route, causing unpredictable behavior and broken navigation.

Using route-based activation, each micro frontend is assigned a specific URL prefix. Single-spa monitors the browser location and activates only the matching application, while all others remain inactive. This approach prevents conflicts, supports deep linking, and ensures smooth transitions between apps, even when mixing modern and legacy applications.

// Each application owns specific URL prefixes.

const routeMatchers = {

"app-a": (location) => location.pathname.startsWith("/app-a"),

"app-b": (location) => location.pathname.startsWith("/app-b"),

"legacy-app": (location) => !isModernRoute(location.pathname),

};

With this setup, navigation is predictable, and each micro frontend can operate independently without interfering with others, providing a stable user experience across the platform.

Development workflow patterns

However, the architecture is only half the battle. The development workflow needs to minimize friction and maintain developer productivity.

Multi-application orchestration

Running multiple micro frontends locally can quickly become cumbersome without proper orchestration. To simplify this, we use a script that starts all registered applications in parallel while also allowing selective startup for specific apps:

# Single command starts all micro frontends

npm run start:all

# Selective development

IGNORE="app-x,app-y" npm run start:all

The command npm run start:all ensures that each application runs on a consistent port and reduces manual setup. When developers need to focus on a subset of applications, they can use the IGNORE variable to skip starting irrelevant apps. This approach abstracts away framework differences and provides a single, convenient entry point for running the full system locally.

Hot reload across frameworks

Maintaining fast feedback loops is essential when working across multiple frameworks. Modern framework development servers offer Hot Module Replacement (HMR), which updates changes instantly without a full page refresh.

In addition, shared libraries are configured to propagate updates automatically. This means that when a common module, such as authentication or theming, is modified, the changes are immediately reflected across all micro frontends without restarting servers. This setup reduces context switching, minimizes downtime during development, and enables multiple teams to work efficiently in parallel.

The shared common library pattern

To prevent code duplication and enforce consistency, all micro frontends import core services from a centralized shared library:

// Every micro frontend imports shared functionality.

import { auth, user, http, themes } from "@site/shared-lib";

// Core shared services prevent code duplication:

export const auth = authService; // Authentication management

export const user = userService; // User context

export const http = httpService; // API client

export const themes = themeService; // Consistent theming

This shared library contains essential services such as authentication, user context, API clients, and theming. By using these centralized modules, each application maintains consistent behavior, reduces bundle size, and avoids duplicating code. This pattern also enables incremental adoption, allowing legacy applications to gradually integrate shared functionality without a full rewrite.

Production patterns and performance

Building micro frontends for production involves more than just writing code — it requires a structured approach to bundling, dependency management, and deployment. Unlike a monolith where a single build produces one output, each micro frontend must be packaged independently, while ensuring shared libraries aren’t duplicated and versions remain consistent. Effective orchestration of the build process is essential to maintain predictable performance, minimize bundle sizes, and streamline deployment across multiple teams.

This leads naturally to the next step: orchestrating production builds in a way that coordinates all applications while maintaining their independence.

Production build orchestration

Building multiple micro frontends for production requires coordinating each application’s bundling, mapping, and versioning. We encapsulate this process in a single asynchronous function:

async function buildProduction() {

await buildAllApplications();

await generateImportMaps();

await applyVersioning();

}

The buildAllApplications() function bundles each micro frontend individually with framework-specific optimizations, ensuring that each app is production-ready. Afterward, generateImportMaps() produces a JSON map that tells the browser where to load each micro frontend and its shared libraries. Finally, applyVersioning() guarantees that deployed applications reference exact versions of libraries, which avoids cache-related bugs and ensures reliable deployments.

Performance optimization results

After implementing this architecture, the performance improvements are evident. Previously, a monolithic application would load a single, very large bundle, resulting in slow initial load times, long build processes, and rigid deployment cycles. Team coordination was also a bottleneck, as releasing a small change required redeploying the entire application.

With our micro frontend approach, shared dependencies are loaded once and applications are lazy-loaded as needed. This leads to smaller initial downloads, faster page loads, and the ability for teams to build and deploy individual apps independently. Feature rollouts can also be selective, reducing risk and improving deployment flexibility.

Before micro frontends

  • Large monolithic bundle
  • Slow initial load times
  • Long build processes
  • Team coordination bottlenecks
  • Deploy everything or nothing

After our architecture

  • Smaller shared dependencies + lazy-loaded apps
  • Faster initial loads (cached)
  • Quick individual app builds
  • Teams deploy independently
  • Selective feature rollouts

Each micro frontend can be containerized and deployed independently using standard Docker patterns.

Migration strategy: From monolith to micro

The key to adopting micro frontends successfully is taking an incremental migration approach rather than attempting a full rewrite.

The graduated migration approach

Phase 1: Extract shell and shared dependencies

Start with single-spa root configuration and common library extraction. Keep the existing monolith as a single application while establishing patterns:

// Initial setup — monolith remains as a single app.

singleSpa.registerApplication(

"legacy-app",

() => import("./legacy-app.js"),

() => true, // Always active initially.

{},

);

Phase 2: Incremental extraction

Extract high-value, low-risk features first:

  • Authentication flows (clear boundaries)
  • Configuration pages (minimal dependencies)
  • New features (start micro from day one)
  • Data visualization components (isolated)
  • Document processing features (consider [Nutrient’s SDK solutions][] for consistent document handling)

Phase 3: Legacy integration

Handle the complex parts with bridge patterns:

// Route-based fallback to legacy application.

const routeMatchers = {

"auth-app": (location) => location.pathname.startsWith("/auth"),

"config-app": (location) => location.pathname.startsWith("/config"),

legacy: (location) => !isExtractedRoute(location.pathname), // Everything else

};

Migration timeline

Below is a realistic enterprise migration approach:

  • Phase 1 — Foundation setup and common library extraction
  • Phase 2 — Extract simple, isolated features first
  • Phase 3 — Gradual legacy integration with bridge patterns

Lessons learned and anti-patterns

Through production experience, we’ve learned what works and what doesn’t.

What works

  • Start with shared dependencies — Get the common library architecture right first
  • Route-based activation — URL patterns prevent application conflicts elegantly
  • Technology graduation — SystemJS → ES modules as applications mature
  • Development port consistency — Consistent port ranges prevent conflicts

What doesn’t work

  • Shared state across boundaries — Keep micro frontends truly independent
  • Complex inter-app communication — Prefer URL-based communication over event buses
  • Framework mixing within apps — One framework per micro frontend, period
  • Perfect shared component libraries — Accept some duplication for true independence
  • Over-engineering coordination — Simple patterns beat complex orchestration

Performance lessons learned

Managing shared dependencies is one of the trickiest aspects of micro frontend architecture. Attempting to share every library across applications might seem efficient, but in practice, it creates version conflicts, brittle builds, and long-term maintenance headaches. Instead, the key is to focus on sharing only the core frameworks and your own common modules. The following example illustrates which dependencies to avoid sharing broadly and which are safe to centralize for consistency and reduced duplication:

// DON'T: Try to share every possible dependency.

const problematicExternals = [

"lodash",

"moment",

"axios",

"ramda",

"date-fns",

// ... 200+ more dependencies

];

// DO: Share framework essentials only.

const effectiveExternals = [

"vue",

"react",

"react-dom",

"@site/*", // Your own modules

];

The sweet spot is sharing frameworks and your own modules while allowing applications to bundle their utility libraries. This prevents version conflicts while maintaining reasonable bundle sizes.

Team organization insights

  • Ownership — Teams own related micro frontends
  • Governance — Central team maintains shared patterns
  • Quality gates — Automated cross-application testing

Advanced patterns

As your micro frontend ecosystem grows, runtime errors in one application can impact the entire platform. To maintain stability and a good user experience, it’s important to handle errors gracefully at both the application and orchestration level. Implementing robust error boundaries ensures failures are contained and reported without breaking unrelated parts of the system.

Error boundaries across applications

In React, error boundaries catch rendering errors in their child components, preventing crashes from propagating. At the single-spa orchestration level, you can also listen for lifecycle events like LOAD_ERROR to detect and log failures when micro frontends fail to load. Combining these approaches gives full-stack resilience, allowing individual micro frontends to fail safely, while keeping the overall platform operational:

// React error boundaries.

class MicroFrontendErrorBoundary extends React.Component {

componentDidCatch(error, errorInfo) {

window.CommonLib.logging.reportError(error, {

...errorInfo,

microFrontend: this.props.appName,

});

}

}

// Single-spa error handling.

window.addEventListener("single-spa:routing-event", (evt) => {

const { appsByNewStatus } = evt.detail;

appsByNewStatus.LOAD_ERROR?.forEach((app) => {

console.error(`Failed to load: ${app.name}`);

});

});

After exploring advanced patterns, including error boundaries and resilient orchestration, you might be wondering how to apply these ideas in practice. To make the concepts concrete, the next section walks through building a simple single-spa micro frontend setup from scratch. This hands-on demo will illustrate route-based activation, independent deployments, and shared orchestration — the very principles discussed in this post — in a manageable, easy-to-follow project.

Getting started: Build your first single-spa application

This section will walk through creating a simple micro frontend setup to demonstrate the core concepts. You’ll build a root application that orchestrates two micro frontends.

Prerequisites

Before starting, ensure you have:

  • Node.js 18+ installed
  • Basic knowledge of JavaScript and modern frameworks
  • A code editor

Step 1: Create the root application

mkdir micro-frontend-demo

cd micro-frontend-demo

mkdir root-app

cd root-app

npm init -y

npm install single-spa

Create index.html:

<!DOCTYPE html>

<html>

<head>

<title>Micro frontend deemo</title>

<script src="https://cdn.jsdelivr.net/npm/systemjs@6.14.1/dist/system.min.js"></script>

<script src="https://cdn.jsdelivr.net/npm/systemjs@6.14.1/dist/extras/amd.min.js"></script>

</head>

<body>

<div id="root"></div>

<script type="systemjs-importmap">

{

"imports": {

"single-spa": "https://cdn.jsdelivr.net/npm/single-spa@5.9.4/lib/system/single-spa.min.js",

"@demo/root": "./root-config.js",

"@demo/navbar": "http://localhost:3001/demo-navbar.js",

"@demo/home": "http://localhost:3003/demo-home.js",

"@demo/dashboard": "http://localhost:3002/demo-dashboard.js"

}

}

</script>

<script type="module">

System.import("@demo/root");

</script>

</body>

</html>

Create root-config.js:

System.register(["single-spa"], function (_export, _context) {

"use strict";

var registerApplication, start;

return {

setters: [

function (_singleSpa) {

registerApplication = _singleSpa.registerApplication;

start = _singleSpa.start;

},

],

execute: function () {

// Register micro frontends.

registerApplication({

name: "@demo/navbar",

app: () => System.import("@demo/navbar"),

activeWhen: () => true, // Always active

});

registerApplication({

name: "@demo/home",

app: () => System.import("@demo/home"),

activeWhen: (location) => location.pathname === "/",

});

registerApplication({

name: "@demo/dashboard",

app: () => System.import("@demo/dashboard"),

activeWhen: (location) => location.pathname.startsWith("/dashboard"),

});

// Start single-spa.

start();

},

};

});

Step 2: Create a navigation bar micro frontend

cd ../

mkdir navbar-app

cd navbar-app

npm init -y

npm install webpack webpack-cli webpack-dev-server single-spa

Create webpack.config.js:

const path = require("path");

module.exports = {

mode: "development",

entry: "./src/demo-navbar.js",

output: {

filename: "demo-navbar.js",

path: path.resolve(__dirname, "dist"),

libraryTarget: "system",

},

devServer: {

port: 3001,

headers: {

"Access-Control-Allow-Origin": "*",

},

},

externals: ["single-spa"],

};

Create src/demo-navbar.js:

let domElement;

export function mount(props) {

domElement = document.createElement("nav");

domElement.innerHTML = `

<style>

nav { background: #333; padding: 1rem; }

nav a { color: white; margin-right: 1rem; text-decoration: none; }

</style>

<a href="/">Home</a>

<a href="/dashboard">Dashboard</a>

`;

document.body.prepend(domElement);

return Promise.resolve();

}

export function unmount(props) {

if (domElement) {

domElement.remove();

}

return Promise.resolve();

}

Step 3: Create a homepage micro frontend

cd ../

mkdir home-app

cd home-app

npm init -y

npm install webpack webpack-cli webpack-dev-server single-spa

Create webpack.config.js:

const path = require("path");

module.exports = {

mode: "development",

entry: "./src/demo-home.js",

output: {

filename: "demo-home.js",

path: path.resolve(__dirname, "dist"),

libraryTarget: "system",

},

devServer: {

port: 3003,

headers: {

"Access-Control-Allow-Origin": "*",

},

},

externals: ["single-spa"],

};

Create src/demo-home.js:

let domElement;

export function mount(props) {

domElement = document.createElement("main");

domElement.innerHTML = `

<style>

main {

padding: 2rem;

max-width: 1200px;

margin: 0 auto;

}

h1 {

color: #333;

font-size: 2.5rem;

margin-bottom: 1rem;

}

p {

color: #666;

font-size: 1.1rem;

line-height: 1.6;

margin-bottom: 1rem;

}

.features {

display: grid;

grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));

gap: 1.5rem;

margin-top: 2rem;

}

.feature-card {

background: #f5f5f5;

padding: 1.5rem;

border-radius: 8px;

border-left: 4px solid #333;

}

.feature-card h3 {

margin-top: 0;

color: #333;

}

</style>

<h1>Welcome to micro frontend demo</h1>

<p>This is a single-spa demonstration showcasing micro frontend architecture patterns.</p>

<p>Each section of this application is loaded independently and can be deployed separately.</p>

<div class="features">

<div class="feature-card">

<h3>Independent deployment</h3>

<p>Each micro frontend can be deployed independently without affecting others.</p>

</div>

<div class="feature-card">

<h3>Framework agnostic</h3>

<p>Different micro frontends can use different frameworks (React, Vue, Angular, etc.).</p>

</div>

<div class="feature-card">

<h3>Route-based activation</h3>

<p>Micro frontends are loaded and mounted based on the current route.</p>

</div>

</div>

`;

document.getElementById("root").appendChild(domElement);

return Promise.resolve();

}

export function unmount(props) {

if (domElement) {

domElement.remove();

}

return Promise.resolve();

}

Step 4: Create a dashboard micro frontend

cd ../

mkdir dashboard-app

cd dashboard-app

npm init -y

npm install webpack webpack-cli webpack-dev-server single-spa

Create webpack.config.js:

const path = require("path");

module.exports = {

mode: "development",

entry: "./src/demo-dashboard.js",

output: {

filename: "demo-dashboard.js",

path: path.resolve(__dirname, "dist"),

libraryTarget: "system",

},

devServer: {

port: 3002,

headers: {

"Access-Control-Allow-Origin": "*",

},

},

externals: ["single-spa"],

};

Create src/demo-dashboard.js:

let domElement;

export function mount(props) {

domElement = document.createElement("main");

domElement.innerHTML = `

<h1>Dashboard</h1>

<p>This is a micro frontend dashboard loaded at runtime.</p>

<div id="dashboard-content">

<h3>Features:</h3>

<ul>

<li>Independent deployment</li>

<li>Framework isolation</li>

<li>Shared routing</li>

</ul>

</div>

`;

document.getElementById("root").appendChild(domElement);

return Promise.resolve();

}

export function unmount(props) {

if (domElement) {

domElement.remove();

}

return Promise.resolve();

}

Step 5: Run the demo

Open four terminals and run:

# Terminal 1 — Root app

cd root-app

npx serve . -p 3000 -s

# Terminal 2 — Navbar app

cd navbar-app

npx webpack serve

# Terminal 3 — Home app

cd home-app

npx webpack serve

# Terminal 4 — Dashboard app

cd dashboard-app

npx webpack serve

Visit http://localhost:3000 to see your micro frontend architecture in action.

What you’ve built

This demo illustrates key micro frontend patterns:

  • Route-based activation — Homepage loads on /, dashboard loads on /dashboard
  • Independent deployment — Each micro frontend runs on its own port (navbar:3001, dashboard:3002, home:3003)
  • Shared orchestration — Root application manages the overall experience
  • Runtime integration — Applications load and mount dynamically
  • Always-active components — Navigation bar remains visible across all routes

Next steps

From here, you can:

  • Replace the vanilla JavaScript with your preferred frameworks (React, Vue, Angular)
  • Add shared dependencies through import maps
  • Implement error boundaries and loading states
  • Implement development utilities (e.g. shared startup script, logging)
  • Add authentication and shared state management

Conclusion: When they make sense

Our production micro frontend architecture demonstrates that with thoughtful patterns, proper tooling, and realistic expectations, you can achieve:

  • Increased team independence with some coordination tradeoffs
  • Technology diversity balanced against complexity costs
  • Incremental migration paths for legacy applications
  • Improved developer experience in specific contexts
  • More flexible deployment cycles for independent features

The key is solving real problems with pragmatic architectural patterns, not following architectural trends.

Use our approach if:

  • You need to migrate legacy applications incrementally
  • You value team autonomy and technology choice flexibility
  • You’re building applications with clear domain boundaries

Stick with monoliths if:

  • You have a small team (fewer than 10 developers)
  • Your application has tight coupling between all features
  • You prioritize simplicity over scalability
  • Performance is more critical than development velocity

In the end, micro frontends aren’t a silver bullet — they’re a scaling tool. When applied thoughtfully, they let teams evolve independently, modernize incrementally, and manage complexity with structure rather than chaos. The patterns outlined here aren’t theoretical; they’re battle-tested solutions from real production systems. Whether you’re starting a migration or refining an existing setup, focus on solving tangible coordination and delivery problems first. That’s where micro frontends truly shine.