SlideShare a Scribd company logo
1 of 17
Micro-Frontends
Sagar Tanaji Bhosale
https://www.linkedin.com/in/sagarbhosale91/
+91 9730910218
https://stackoverflow.com/users/3497603/sagar-bhosale
about.me/sagarbhosale
What are
Micro-
Frontends?
Micro-frontend architecture is a design
approach in which a front-end app is
decomposed into individual, semi-
independent “microapps” working loosely
together. The micro-frontend concept is
vaguely inspired by, and named after,
microservices.
An History of Evolution
An History of Evolution - Future
Organization in Verticals
Micro Frontend Benefits
3
4
5
2
1
Freedom in
stack’s
choices
Small
Customer
Centric
Teams
Autonomous
development and
deployment
Autonomous testing
and release of
features
Application’s
evolution made
easier
Micro
Frontend
Autonomous teams
Freedom in stack’s choices
•App1 developed in React can be served from domainA, developed by Team A, with its
own deployments cycles, testing, etc…
•App 4 developed in Angular can be served from domainB, developed by Team B, with its
own deployments cycles, testing, etc…
The Search module can be done with Technology A, the Authentication module can de done
with Technology B, and so on.
Autonomous development and
deployment
Who is using Micro Frontends?
▪ Amazon — Ecommerce site
▪ Upwork
▪ Spotify
▪ HelloFresh
▪ Zalando
▪ OpenTable
and so on …
Implementation strategies
❑ Server-side composition :
Here HTML file is rendered on server, which contain any common page elements and then uses the
server side to plug in page-specific content from fragment HTML files.
server {
listen 8080;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
ssi on;
# Redirect / to /browse
rewrite ^/$ http://localhost:8080/product redirect;
# Decide which HTML fragment to insert based on the URL
location /browse {
set $PAGE 'product';
}
location /order {
set $PAGE 'order';
}
location /profile {
set $PAGE 'profile'
}
# All locations should render through index.html
error_page 404 /index.html;
}
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>E-commerce container</title>
</head>
<body>
<h1> E-commerce </h1>
<!--# include file="$PAGE.html" -->
</body>
</html>
Implementation strategies
❑ Build-time integration :
The approach where each micro frontend app is published as a package and have the container
app which includes them all as library dependencies. Here is how the package.json will look like :
{
"name": "@e-commerce/container",
"version": "1.0.0",
"description": "A product delivery app",
"dependencies": {
"@e-commerce/products": "^1.2.3",
"@e-commerce/order-products": "^4.5.6",
"@e-commerce/user-profile": "^7.8.9"
}
}
Implementation strategies
❑ Integration via iframes (Client-side integration) :
▪ In this (old) approach, we can have a single page with multiple inner
applications, each one in a different iframe.
▪ window postMessage() is used to communicate between the applications.
▪ Not suitable for responsive design and complex routing/deep linking
Implementation strategies
❑ Using Web Components :
• Enable to create reusable custom elements
• In runtime integration via web components, each micro frontend defines an HTML
element for the container to represent an instance instead of defining a global
function called by the container. Web Components are isolated components that
can be (re)used in HTML pages and web applications. These are also known as
custom elements.
Custom Element than can be reused in any HTML file :
<evil-plan ransom="a single dollar"></evil-plan>
Implementation strategies
❑ Module Federation –
• Webpack 5 core feature which allows a JavaScript application to dynamically load code from
another application.
• The code is loaded dynamically, and if a dependency is missing, the dependency will be
downloaded by the host application, which allows for less code duplication in the application.
• For example, if you’re downloading a React component, your application won’t import React
code twice. The module will smartly use the React source you already have and only import
the component code.
• Terminologies :
name
Acting as a name of the remote module
host
The currently running application that is hosting federated remote modules.
remote
A reference to an external federated module.
expose
A module that is exported from an application is “exposed”.
module
The smallest unit of shareable code. Can be a single file.
HOST
Remote
Downsides
▪ Payload size :
There might be multiple download requirements to ensure complete functionality and browser support.
▪ Consistent user experience :
For the user experience to remain cohesive and consistent, there must be a common understanding
across teams.
▪ Operational and governance complexity :
It is possible for developers to overpopulate their project with too many components as time goes on,
causing multiple testing and deployment-phase issues to appear across several teams.
▪ Resources :
Project must have access to multiple teams and sufficient size or resources. One team would be
responsible for the creation, testing, and deployment of multiple modules, possibly across several
languages, rather than just attending to one code base.
Thank you !

More Related Content

Similar to MicroForntends.pdf

Internship-Report-VitulChauhan-18132023-IT_CRUD-OPERATION.pdf
Internship-Report-VitulChauhan-18132023-IT_CRUD-OPERATION.pdfInternship-Report-VitulChauhan-18132023-IT_CRUD-OPERATION.pdf
Internship-Report-VitulChauhan-18132023-IT_CRUD-OPERATION.pdfVitulChauhan
 
Resume - Parag Bhayani
Resume - Parag BhayaniResume - Parag Bhayani
Resume - Parag BhayaniParag Bhayani
 
CS2810Team6GroupReport
CS2810Team6GroupReportCS2810Team6GroupReport
CS2810Team6GroupReportDan Coles
 
Simplify DevOps with Microservices and Mobile Backends.pptx
Simplify DevOps with Microservices and Mobile Backends.pptxSimplify DevOps with Microservices and Mobile Backends.pptx
Simplify DevOps with Microservices and Mobile Backends.pptxssuser5faa791
 
In Act Developers Platform
In Act Developers PlatformIn Act Developers Platform
In Act Developers PlatformEris Ristemena
 
IBM Connections Cloud Application Development Strategy
IBM Connections Cloud Application Development StrategyIBM Connections Cloud Application Development Strategy
IBM Connections Cloud Application Development StrategyLuis Benitez
 
MuleSoft Surat Virtual Meetup#15 - Caching Scope, Caching Strategy and Jenkin...
MuleSoft Surat Virtual Meetup#15 - Caching Scope, Caching Strategy and Jenkin...MuleSoft Surat Virtual Meetup#15 - Caching Scope, Caching Strategy and Jenkin...
MuleSoft Surat Virtual Meetup#15 - Caching Scope, Caching Strategy and Jenkin...Jitendra Bafna
 
A report on mvc using the information
A report on mvc using the informationA report on mvc using the information
A report on mvc using the informationToushik Paul
 
Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Apigee | Google Cloud
 
12 factor app - Core Guidelines To Cloud Ready Solutions
12 factor app - Core Guidelines To Cloud Ready Solutions12 factor app - Core Guidelines To Cloud Ready Solutions
12 factor app - Core Guidelines To Cloud Ready SolutionsKashif Ali Siddiqui
 
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai..."Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...Fwdays
 
ngStockholm #8 at NetEnt - Micro Frontend Architecture
ngStockholm #8 at NetEnt - Micro Frontend ArchitecturengStockholm #8 at NetEnt - Micro Frontend Architecture
ngStockholm #8 at NetEnt - Micro Frontend ArchitectureIshaan Puniani
 
Deployment Automation for Hybrid Cloud and Multi-Platform Environments
Deployment Automation for Hybrid Cloud and Multi-Platform EnvironmentsDeployment Automation for Hybrid Cloud and Multi-Platform Environments
Deployment Automation for Hybrid Cloud and Multi-Platform EnvironmentsIBM UrbanCode Products
 
AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)Alex Ross
 
Prominent Back-end frameworks to consider in 2022!
Prominent Back-end frameworks to consider in 2022!Prominent Back-end frameworks to consider in 2022!
Prominent Back-end frameworks to consider in 2022!Shelly Megan
 
Ora_Case_Study_Oracle Application Development Framework
Ora_Case_Study_Oracle Application Development FrameworkOra_Case_Study_Oracle Application Development Framework
Ora_Case_Study_Oracle Application Development FrameworkNeha Singh
 
Driving Enterprise Architecture Redesign: Cloud-Native Platforms, APIs, and D...
Driving Enterprise Architecture Redesign: Cloud-Native Platforms, APIs, and D...Driving Enterprise Architecture Redesign: Cloud-Native Platforms, APIs, and D...
Driving Enterprise Architecture Redesign: Cloud-Native Platforms, APIs, and D...WSO2
 

Similar to MicroForntends.pdf (20)

Internship-Report-VitulChauhan-18132023-IT_CRUD-OPERATION.pdf
Internship-Report-VitulChauhan-18132023-IT_CRUD-OPERATION.pdfInternship-Report-VitulChauhan-18132023-IT_CRUD-OPERATION.pdf
Internship-Report-VitulChauhan-18132023-IT_CRUD-OPERATION.pdf
 
Resume - Parag Bhayani
Resume - Parag BhayaniResume - Parag Bhayani
Resume - Parag Bhayani
 
CS2810Team6GroupReport
CS2810Team6GroupReportCS2810Team6GroupReport
CS2810Team6GroupReport
 
Simplify DevOps with Microservices and Mobile Backends.pptx
Simplify DevOps with Microservices and Mobile Backends.pptxSimplify DevOps with Microservices and Mobile Backends.pptx
Simplify DevOps with Microservices and Mobile Backends.pptx
 
Top 5 backend frameworks for web development in.pptx
Top 5 backend frameworks for web development in.pptxTop 5 backend frameworks for web development in.pptx
Top 5 backend frameworks for web development in.pptx
 
Naresh Chirra
Naresh ChirraNaresh Chirra
Naresh Chirra
 
In Act Developers Platform
In Act Developers PlatformIn Act Developers Platform
In Act Developers Platform
 
IBM Connections Cloud Application Development Strategy
IBM Connections Cloud Application Development StrategyIBM Connections Cloud Application Development Strategy
IBM Connections Cloud Application Development Strategy
 
MuleSoft Surat Virtual Meetup#15 - Caching Scope, Caching Strategy and Jenkin...
MuleSoft Surat Virtual Meetup#15 - Caching Scope, Caching Strategy and Jenkin...MuleSoft Surat Virtual Meetup#15 - Caching Scope, Caching Strategy and Jenkin...
MuleSoft Surat Virtual Meetup#15 - Caching Scope, Caching Strategy and Jenkin...
 
A report on mvc using the information
A report on mvc using the informationA report on mvc using the information
A report on mvc using the information
 
Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?
 
12 factor app - Core Guidelines To Cloud Ready Solutions
12 factor app - Core Guidelines To Cloud Ready Solutions12 factor app - Core Guidelines To Cloud Ready Solutions
12 factor app - Core Guidelines To Cloud Ready Solutions
 
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai..."Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
 
ngStockholm #8 at NetEnt - Micro Frontend Architecture
ngStockholm #8 at NetEnt - Micro Frontend ArchitecturengStockholm #8 at NetEnt - Micro Frontend Architecture
ngStockholm #8 at NetEnt - Micro Frontend Architecture
 
Deployment Automation for Hybrid Cloud and Multi-Platform Environments
Deployment Automation for Hybrid Cloud and Multi-Platform EnvironmentsDeployment Automation for Hybrid Cloud and Multi-Platform Environments
Deployment Automation for Hybrid Cloud and Multi-Platform Environments
 
AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)
 
Resume
ResumeResume
Resume
 
Prominent Back-end frameworks to consider in 2022!
Prominent Back-end frameworks to consider in 2022!Prominent Back-end frameworks to consider in 2022!
Prominent Back-end frameworks to consider in 2022!
 
Ora_Case_Study_Oracle Application Development Framework
Ora_Case_Study_Oracle Application Development FrameworkOra_Case_Study_Oracle Application Development Framework
Ora_Case_Study_Oracle Application Development Framework
 
Driving Enterprise Architecture Redesign: Cloud-Native Platforms, APIs, and D...
Driving Enterprise Architecture Redesign: Cloud-Native Platforms, APIs, and D...Driving Enterprise Architecture Redesign: Cloud-Native Platforms, APIs, and D...
Driving Enterprise Architecture Redesign: Cloud-Native Platforms, APIs, and D...
 

Recently uploaded

cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 

Recently uploaded (20)

cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 

MicroForntends.pdf

  • 1. Micro-Frontends Sagar Tanaji Bhosale https://www.linkedin.com/in/sagarbhosale91/ +91 9730910218 https://stackoverflow.com/users/3497603/sagar-bhosale about.me/sagarbhosale
  • 2. What are Micro- Frontends? Micro-frontend architecture is a design approach in which a front-end app is decomposed into individual, semi- independent “microapps” working loosely together. The micro-frontend concept is vaguely inspired by, and named after, microservices.
  • 3. An History of Evolution
  • 4. An History of Evolution - Future Organization in Verticals
  • 5. Micro Frontend Benefits 3 4 5 2 1 Freedom in stack’s choices Small Customer Centric Teams Autonomous development and deployment Autonomous testing and release of features Application’s evolution made easier Micro Frontend
  • 7. Freedom in stack’s choices •App1 developed in React can be served from domainA, developed by Team A, with its own deployments cycles, testing, etc… •App 4 developed in Angular can be served from domainB, developed by Team B, with its own deployments cycles, testing, etc… The Search module can be done with Technology A, the Authentication module can de done with Technology B, and so on.
  • 9. Who is using Micro Frontends? ▪ Amazon — Ecommerce site ▪ Upwork ▪ Spotify ▪ HelloFresh ▪ Zalando ▪ OpenTable and so on …
  • 10. Implementation strategies ❑ Server-side composition : Here HTML file is rendered on server, which contain any common page elements and then uses the server side to plug in page-specific content from fragment HTML files. server { listen 8080; server_name localhost; root /usr/share/nginx/html; index index.html; ssi on; # Redirect / to /browse rewrite ^/$ http://localhost:8080/product redirect; # Decide which HTML fragment to insert based on the URL location /browse { set $PAGE 'product'; } location /order { set $PAGE 'order'; } location /profile { set $PAGE 'profile' } # All locations should render through index.html error_page 404 /index.html; } <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title>E-commerce container</title> </head> <body> <h1> E-commerce </h1> <!--# include file="$PAGE.html" --> </body> </html>
  • 11. Implementation strategies ❑ Build-time integration : The approach where each micro frontend app is published as a package and have the container app which includes them all as library dependencies. Here is how the package.json will look like : { "name": "@e-commerce/container", "version": "1.0.0", "description": "A product delivery app", "dependencies": { "@e-commerce/products": "^1.2.3", "@e-commerce/order-products": "^4.5.6", "@e-commerce/user-profile": "^7.8.9" } }
  • 12. Implementation strategies ❑ Integration via iframes (Client-side integration) : ▪ In this (old) approach, we can have a single page with multiple inner applications, each one in a different iframe. ▪ window postMessage() is used to communicate between the applications. ▪ Not suitable for responsive design and complex routing/deep linking
  • 13. Implementation strategies ❑ Using Web Components : • Enable to create reusable custom elements • In runtime integration via web components, each micro frontend defines an HTML element for the container to represent an instance instead of defining a global function called by the container. Web Components are isolated components that can be (re)used in HTML pages and web applications. These are also known as custom elements. Custom Element than can be reused in any HTML file : <evil-plan ransom="a single dollar"></evil-plan>
  • 14. Implementation strategies ❑ Module Federation – • Webpack 5 core feature which allows a JavaScript application to dynamically load code from another application. • The code is loaded dynamically, and if a dependency is missing, the dependency will be downloaded by the host application, which allows for less code duplication in the application. • For example, if you’re downloading a React component, your application won’t import React code twice. The module will smartly use the React source you already have and only import the component code. • Terminologies : name Acting as a name of the remote module host The currently running application that is hosting federated remote modules. remote A reference to an external federated module. expose A module that is exported from an application is “exposed”. module The smallest unit of shareable code. Can be a single file.
  • 16. Downsides ▪ Payload size : There might be multiple download requirements to ensure complete functionality and browser support. ▪ Consistent user experience : For the user experience to remain cohesive and consistent, there must be a common understanding across teams. ▪ Operational and governance complexity : It is possible for developers to overpopulate their project with too many components as time goes on, causing multiple testing and deployment-phase issues to appear across several teams. ▪ Resources : Project must have access to multiple teams and sufficient size or resources. One team would be responsible for the creation, testing, and deployment of multiple modules, possibly across several languages, rather than just attending to one code base.