SlideShare a Scribd company logo
1 of 29
Download to read offline
Micro Frontends
Web component approach con VUEJS
ANDREA CAMPACI | IT ARCHITECT
WORKSHOP
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI 2
🙏
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI
Andrea Campaci
IT Architect @ Banca Mediolanum S.p.A.
//andreacampaci.it
info@andreacampaci.it
3
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI 4
Contenuti
del
workshop
Architettura
01
Web components
02
Facciamo pratica
04
Q&A
05
Vue CLI
03
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI 5
Repository
di
riferimento
$ git checkout workshop
$ npm run bootstrap
Enjoy!!
andreacampaci/micro-fe-vue2-wc
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI
01 Architettura
6
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI
Application
7
01 Architettura
The Monolith
Frontend
Backend
Frontend
Aggregation Layer
Microservice
Microservice
Microservice
Front & Back Microservices
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI
Micro Frontends
Overview
L’idea del pattern nasce dalla
necessità di far realizzare a team
indipendenti funzionalità business
e2e.
Team PRJ Z
Es. product list, create, edit,
delete
Team PRJ Y
Es. user login and
registration
Team PRJ X
Es. cart fn, add & remove
item, buy wizard
Frontend
Backend
Database
8
01 Architettura
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI 9
01 Architettura
Driver
Principali
Resilienza Performance Scalabilità Unlock
• Utilizzo di più framework.
• Ideale per chi vuole migrare
la propria architettura verso
un altro framework,
prevenendo l’obsolescenza
del software.
• Team con know how
tecnologici differenti
possono collaborare alla
produzione di componenti
software per un unico
progetto.
• Parallelizzazione delle
attività di sviluppo.
• Ogni micro app viene
sviluppata, testata,
rilasciata separatamente.
• Ogni micro applicazione FE
ha un bundle estremamente
piccolo, ottimizzabile
ulteriormente utilizzando il
code splitting.
• Alcuni file vendor possono
essere esternalizzati per poi
essere condivisi
univocamente.
• Seguendo il principio CCP
(Common Closure
Principle), ogni componente
software è auto-
consistente e responsabile
di un solo dominio.
• Ogni micro applicazione
gestisce il proprio error
handling senza bloccare le
altre in pagina.
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI
SUB-DOMAIN HTML FRAGMENTS
WEB COMPONENT IFRAME
• Standard HTML
• Reattività
• Isolamento CSS
• Necessita di polyfill in IE11
• Forte isolamento
• Poca comunicazione
• Performance
• CORS issues
• Scomposizione
• Nessuno standard presente
• CSS presente in pagina
10
01 Architettura
Differenti
approcci
• Nessuna comunicazione
• Forte isolamento
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI
PRESENTATION
LAYER
PORTAL
11
01 Architettura
Architettura
logica
AGGREGATION
LAYER
WIDGET
BFF
WIDGET
WIDGET
BUSINESS
LAYER WIDGET
MICROSERVICES
DATA
LAYER
DATA
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI 12
01 Architettura
Principi
di
responsabilità
Portale (Shell)
• Carica
• Orchestra
• Compone
• Naviga
• Autentica
Widget
• Business
• Business
• Business
PRESENTATION
LAYER
PORTAL WIDGET
WIDGET
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI 13
01 Architettura
Componenti
a
fattor
comune
PRESENTATION
LAYER
UI Library Framework Event Broker
Nav Utils
Http Service Handler Error
PORTAL WIDGET
WIDGET
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI 14
01 Architettura
Comunicazione
tra
widget
Widget A Widget B Portal
Event Bus
subscribe
dispatch(data)
data
custom event (data)
data
Broker
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI
02 Web components
15
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI
Cosa sono?
Componenti create con diverse
librerie/framework, le cui
funzionalità sono incapsulate
rispetto al codice presente in
pagina e possono essere
riutilizzate in differenti applicazioni
web.
16
02 Web components
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI 17
02 Web components
Librerie
e
framework
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI 18
Principali
proprietà Custom
elements
ESM (Moduli) Shadow DOM CSS Scope
Il CSS viene isolato
dall’esterno in modo che
l’applicazione resti consistente
indipendente dal contesto.
Un aspetto importante dei
Web Component è
l'incapsulamento: essere in
grado di mantenere la
struttura, lo stile e il
comportamento separato da
altro codice nella pagina.
I moduli JS sono la base della
tecnologia web component.
Questa funzionalità introdotta
da JS permette di importare ed
esportare codice JS in moduli
rendendo riutilizzabile il codice
in altre applicazioni.
I Custom Elements
permettono di creare elementi
HTML (Tags) nativi che
possono implementare da una
singola funzionalità ad un
intera applicazione.
Lo scopo di tali elementi è
essere riutilizzabili.
02 Web components
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI 19
Struttura
logica
02 Web components
Documento HTML
Custom Element
Shadow DOM
APP
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI 20
Supporto
Browsers
02 Web components
✓ ✓ ✓
✓ ✓
✘
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI
03 Vue CLI
21
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI 22
03 Vue CLI
Creazione
del
componente
$ vue-cli-service build --target wc
$ vue create [widget-name]
La creazione di un nuovo
progetto avviene tramite CLI
con il seguente comando:
Una volta che l’applicazione
è completata, accodare al
comando di build l’attributo
“target” dal valore Web
Component
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI 23
03 Vue CLI
Proprietà
in
input
L’injection di dati
dall’esterno avvengono
tramite data-binding;
Sfruttando quindi le
proprietà del componente
principale Vue (App.vue)
possiamo definire quali sono
i dati che possiamo passare
in input al nostro Web
Component.
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI 24
03 Vue CLI
Dispatch
di
eventi
Allo stesso modo delle
proprietà, ogni evento
lanciato dal componente
principale (App.vue) viene
automaticamente
trasformato in un Custom
Event. L’evento pubblicato
potrà essere ascoltato sul
Custom Element.
this.$emit(“event-name”, data)
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI 25
03 Vue CLI
Caricamento
da
una
Shell
Static Lazy
Documento HTML Documento HTML
app1.js app2.js
SHELL
app1.js
app2.js
Widget 1
app1.js
Widget 1
SHELL
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI
04 Facciamo pratica
26
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI
DOC HTML
DOC HTML
DOC HTML DOC HTML
DOC HTML
DOC HTML
DOC HTML
DOC HTML
27
04 Facciamo pratica
DOC HTML
SHELL
Home tab
Todo List
tab
WIDGET 1 WIDGET 2
WIDGET
LIST
WIDGET
FORM
DOC HTML
Struttura
del progetto
Creeremo un applicazione nella
quale saranno presenti due tab
“Home” e “Todo list”. Entrambe le
pagine ospiteranno due widget
diversi tra loro caricati in maniera
Lazy.
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI 28
Q&A
MICRO FRONTENDS WORKSHOP |
ANDREA CAMPACI
Thank "
29
info@andreacampaci.it

More Related Content

What's hot

Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMiki Lombardi
 
Micro frontend architecture_presentation_ssoni
Micro frontend architecture_presentation_ssoniMicro frontend architecture_presentation_ssoni
Micro frontend architecture_presentation_ssoniSandeep Soni
 
FEVR - Micro Frontend
FEVR - Micro FrontendFEVR - Micro Frontend
FEVR - Micro FrontendMiki Lombardi
 
Introduction To Micro Frontends
Introduction To Micro Frontends Introduction To Micro Frontends
Introduction To Micro Frontends Meitar Karas
 
Software architecture in practice
Software architecture in practiceSoftware architecture in practice
Software architecture in practiceErwannWernli
 
Make your animations perform well - Anna Migas - Codemotion Rome 2017
Make your animations perform well - Anna Migas - Codemotion Rome 2017Make your animations perform well - Anna Migas - Codemotion Rome 2017
Make your animations perform well - Anna Migas - Codemotion Rome 2017Codemotion
 
Globant development week / Micro frontend
Globant development week / Micro frontendGlobant development week / Micro frontend
Globant development week / Micro frontendGlobant
 
TUTTO SU VISUAL STUDIO ALM 2015
TUTTO SU VISUAL STUDIO ALM 2015TUTTO SU VISUAL STUDIO ALM 2015
TUTTO SU VISUAL STUDIO ALM 2015DotNetCampus
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkRapidValue
 
Serverless with Firebase - Launchpad Build Burgos
Serverless with Firebase - Launchpad Build Burgos Serverless with Firebase - Launchpad Build Burgos
Serverless with Firebase - Launchpad Build Burgos Carlos Azaustre
 
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...Massimo Bonanni
 
Dnc2015 azure-microservizi-vforusso
Dnc2015 azure-microservizi-vforussoDnc2015 azure-microservizi-vforusso
Dnc2015 azure-microservizi-vforussoDotNetCampus
 
Transporting Data at Warp Speed: How to Connect Spring Boot Apps Quickly, Pow...
Transporting Data at Warp Speed: How to Connect Spring Boot Apps Quickly, Pow...Transporting Data at Warp Speed: How to Connect Spring Boot Apps Quickly, Pow...
Transporting Data at Warp Speed: How to Connect Spring Boot Apps Quickly, Pow...VMware Tanzu
 
Net core path by Ibon Landa
Net core path by Ibon LandaNet core path by Ibon Landa
Net core path by Ibon LandaPlain Concepts
 
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
 
Web And Cloud Tour 2015 - ASP.NET 5
Web And Cloud Tour 2015 -  ASP.NET 5 Web And Cloud Tour 2015 -  ASP.NET 5
Web And Cloud Tour 2015 - ASP.NET 5 Marc Rubiño
 
Microservices for the Masses with Spring Boot, JHipster, and JWT - Devoxx UK...
 Microservices for the Masses with Spring Boot, JHipster, and JWT - Devoxx UK... Microservices for the Masses with Spring Boot, JHipster, and JWT - Devoxx UK...
Microservices for the Masses with Spring Boot, JHipster, and JWT - Devoxx UK...Matt Raible
 

What's hot (20)

Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - Plansoft
 
Micro frontend architecture_presentation_ssoni
Micro frontend architecture_presentation_ssoniMicro frontend architecture_presentation_ssoni
Micro frontend architecture_presentation_ssoni
 
FEVR - Micro Frontend
FEVR - Micro FrontendFEVR - Micro Frontend
FEVR - Micro Frontend
 
Introduction To Micro Frontends
Introduction To Micro Frontends Introduction To Micro Frontends
Introduction To Micro Frontends
 
Software architecture in practice
Software architecture in practiceSoftware architecture in practice
Software architecture in practice
 
Make your animations perform well - Anna Migas - Codemotion Rome 2017
Make your animations perform well - Anna Migas - Codemotion Rome 2017Make your animations perform well - Anna Migas - Codemotion Rome 2017
Make your animations perform well - Anna Migas - Codemotion Rome 2017
 
Globant development week / Micro frontend
Globant development week / Micro frontendGlobant development week / Micro frontend
Globant development week / Micro frontend
 
TUTTO SU VISUAL STUDIO ALM 2015
TUTTO SU VISUAL STUDIO ALM 2015TUTTO SU VISUAL STUDIO ALM 2015
TUTTO SU VISUAL STUDIO ALM 2015
 
Micro frontends
Micro frontendsMicro frontends
Micro frontends
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular Framework
 
Serverless with Firebase - Launchpad Build Burgos
Serverless with Firebase - Launchpad Build Burgos Serverless with Firebase - Launchpad Build Burgos
Serverless with Firebase - Launchpad Build Burgos
 
Micro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJS
Micro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJSMicro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJS
Micro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJS
 
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...
 
Dnc2015 azure-microservizi-vforusso
Dnc2015 azure-microservizi-vforussoDnc2015 azure-microservizi-vforusso
Dnc2015 azure-microservizi-vforusso
 
Transporting Data at Warp Speed: How to Connect Spring Boot Apps Quickly, Pow...
Transporting Data at Warp Speed: How to Connect Spring Boot Apps Quickly, Pow...Transporting Data at Warp Speed: How to Connect Spring Boot Apps Quickly, Pow...
Transporting Data at Warp Speed: How to Connect Spring Boot Apps Quickly, Pow...
 
React.js + azure signal r
React.js  + azure signal r React.js  + azure signal r
React.js + azure signal r
 
Net core path by Ibon Landa
Net core path by Ibon LandaNet core path by Ibon Landa
Net core path by Ibon Landa
 
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
 
Web And Cloud Tour 2015 - ASP.NET 5
Web And Cloud Tour 2015 -  ASP.NET 5 Web And Cloud Tour 2015 -  ASP.NET 5
Web And Cloud Tour 2015 - ASP.NET 5
 
Microservices for the Masses with Spring Boot, JHipster, and JWT - Devoxx UK...
 Microservices for the Masses with Spring Boot, JHipster, and JWT - Devoxx UK... Microservices for the Masses with Spring Boot, JHipster, and JWT - Devoxx UK...
Microservices for the Masses with Spring Boot, JHipster, and JWT - Devoxx UK...
 

Similar to Micro frontends Web component approach con VUEJS

Moving to a headless solution based on sitecore 9 and javascript services
Moving to a headless solution based on sitecore 9 and javascript servicesMoving to a headless solution based on sitecore 9 and javascript services
Moving to a headless solution based on sitecore 9 and javascript servicesMohamed Krimi
 
THE MONSTER UNDER THE BED – OVERENGINEERING THE CLOUD
THE MONSTER UNDER THE BED – OVERENGINEERING THE CLOUDTHE MONSTER UNDER THE BED – OVERENGINEERING THE CLOUD
THE MONSTER UNDER THE BED – OVERENGINEERING THE CLOUDRadu Vunvulea
 
NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014
NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014
NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014Stéphane ESCANDELL
 
Build your mobile architecture in Oracle Cloud
Build your mobile architecture in Oracle CloudBuild your mobile architecture in Oracle Cloud
Build your mobile architecture in Oracle CloudRuben Rodriguez
 
Zero-downtime deployment of Micro-services with Kubernetes
Zero-downtime deployment of Micro-services with KubernetesZero-downtime deployment of Micro-services with Kubernetes
Zero-downtime deployment of Micro-services with KubernetesWojciech Barczyński
 
Claris Engage 2020, FileMaker Pro 19.1, and FileMaker Server 19.1
Claris Engage 2020, FileMaker Pro 19.1, and FileMaker Server 19.1Claris Engage 2020, FileMaker Pro 19.1, and FileMaker Server 19.1
Claris Engage 2020, FileMaker Pro 19.1, and FileMaker Server 19.1DB Services
 
Micro-Frontends JSVidCon
Micro-Frontends JSVidConMicro-Frontends JSVidCon
Micro-Frontends JSVidConAmir Zuker
 
SAPTechED 2015 UX114 -Building custom SAP Fiori Apps Using SAP Web IDE
SAPTechED 2015 UX114 -Building custom SAP Fiori Apps Using SAP Web IDESAPTechED 2015 UX114 -Building custom SAP Fiori Apps Using SAP Web IDE
SAPTechED 2015 UX114 -Building custom SAP Fiori Apps Using SAP Web IDEMarkus Van Kempen
 
ICONUK 2014 - From Idea To App
ICONUK 2014 - From Idea To AppICONUK 2014 - From Idea To App
ICONUK 2014 - From Idea To AppRené Winkelmeyer
 
[Webinar] Announcing the Camunda Cloud Public Beta - February 2020
[Webinar] Announcing the Camunda Cloud Public Beta - February 2020[Webinar] Announcing the Camunda Cloud Public Beta - February 2020
[Webinar] Announcing the Camunda Cloud Public Beta - February 2020camunda services GmbH
 
DITA Authoring, TERM CHECK and automated Deployment
DITA Authoring, TERM CHECK and automated DeploymentDITA Authoring, TERM CHECK and automated Deployment
DITA Authoring, TERM CHECK and automated DeploymentGeorg Eck
 
Integration (Application?) Modernization with IBM Garage
Integration (Application?) Modernization with IBM GarageIntegration (Application?) Modernization with IBM Garage
Integration (Application?) Modernization with IBM GarageAndrew Ferrier
 
A Blueprint for Cloud-Native Financial Institutions
A Blueprint for Cloud-Native Financial InstitutionsA Blueprint for Cloud-Native Financial Institutions
A Blueprint for Cloud-Native Financial InstitutionsAngelo Agatino Nicolosi
 
O2 platform and ASP.NET MVC, by Michael Hidalgo
O2 platform and ASP.NET MVC, by Michael HidalgoO2 platform and ASP.NET MVC, by Michael Hidalgo
O2 platform and ASP.NET MVC, by Michael HidalgoDinis Cruz
 
Serverless Toronto User Group - Let's go Serverless!
Serverless Toronto User Group - Let's go Serverless!Serverless Toronto User Group - Let's go Serverless!
Serverless Toronto User Group - Let's go Serverless!Daniel Zivkovic
 
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREMicroservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREAraf Karsh Hamid
 
Create A Mapping Web Part
Create A Mapping Web PartCreate A Mapping Web Part
Create A Mapping Web PartTom Resing
 
Acquia Platform Update: New Features and Capabilities
Acquia Platform Update: New Features and CapabilitiesAcquia Platform Update: New Features and Capabilities
Acquia Platform Update: New Features and CapabilitiesAcquia
 

Similar to Micro frontends Web component approach con VUEJS (20)

Moving to a headless solution based on sitecore 9 and javascript services
Moving to a headless solution based on sitecore 9 and javascript servicesMoving to a headless solution based on sitecore 9 and javascript services
Moving to a headless solution based on sitecore 9 and javascript services
 
THE MONSTER UNDER THE BED – OVERENGINEERING THE CLOUD
THE MONSTER UNDER THE BED – OVERENGINEERING THE CLOUDTHE MONSTER UNDER THE BED – OVERENGINEERING THE CLOUD
THE MONSTER UNDER THE BED – OVERENGINEERING THE CLOUD
 
NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014
NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014
NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014
 
Build your mobile architecture in Oracle Cloud
Build your mobile architecture in Oracle CloudBuild your mobile architecture in Oracle Cloud
Build your mobile architecture in Oracle Cloud
 
agile microservices @scaibo
agile microservices @scaiboagile microservices @scaibo
agile microservices @scaibo
 
Zero-downtime deployment of Micro-services with Kubernetes
Zero-downtime deployment of Micro-services with KubernetesZero-downtime deployment of Micro-services with Kubernetes
Zero-downtime deployment of Micro-services with Kubernetes
 
Claris Engage 2020, FileMaker Pro 19.1, and FileMaker Server 19.1
Claris Engage 2020, FileMaker Pro 19.1, and FileMaker Server 19.1Claris Engage 2020, FileMaker Pro 19.1, and FileMaker Server 19.1
Claris Engage 2020, FileMaker Pro 19.1, and FileMaker Server 19.1
 
Micro-Frontends JSVidCon
Micro-Frontends JSVidConMicro-Frontends JSVidCon
Micro-Frontends JSVidCon
 
SAPTechED 2015 UX114 -Building custom SAP Fiori Apps Using SAP Web IDE
SAPTechED 2015 UX114 -Building custom SAP Fiori Apps Using SAP Web IDESAPTechED 2015 UX114 -Building custom SAP Fiori Apps Using SAP Web IDE
SAPTechED 2015 UX114 -Building custom SAP Fiori Apps Using SAP Web IDE
 
ICONUK 2014 - From Idea To App
ICONUK 2014 - From Idea To AppICONUK 2014 - From Idea To App
ICONUK 2014 - From Idea To App
 
[Webinar] Announcing the Camunda Cloud Public Beta - February 2020
[Webinar] Announcing the Camunda Cloud Public Beta - February 2020[Webinar] Announcing the Camunda Cloud Public Beta - February 2020
[Webinar] Announcing the Camunda Cloud Public Beta - February 2020
 
DITA Authoring, TERM CHECK and automated Deployment
DITA Authoring, TERM CHECK and automated DeploymentDITA Authoring, TERM CHECK and automated Deployment
DITA Authoring, TERM CHECK and automated Deployment
 
Integration (Application?) Modernization with IBM Garage
Integration (Application?) Modernization with IBM GarageIntegration (Application?) Modernization with IBM Garage
Integration (Application?) Modernization with IBM Garage
 
A Blueprint for Cloud-Native Financial Institutions
A Blueprint for Cloud-Native Financial InstitutionsA Blueprint for Cloud-Native Financial Institutions
A Blueprint for Cloud-Native Financial Institutions
 
O2 platform and ASP.NET MVC, by Michael Hidalgo
O2 platform and ASP.NET MVC, by Michael HidalgoO2 platform and ASP.NET MVC, by Michael Hidalgo
O2 platform and ASP.NET MVC, by Michael Hidalgo
 
Docker12 factor
Docker12 factorDocker12 factor
Docker12 factor
 
Serverless Toronto User Group - Let's go Serverless!
Serverless Toronto User Group - Let's go Serverless!Serverless Toronto User Group - Let's go Serverless!
Serverless Toronto User Group - Let's go Serverless!
 
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREMicroservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SRE
 
Create A Mapping Web Part
Create A Mapping Web PartCreate A Mapping Web Part
Create A Mapping Web Part
 
Acquia Platform Update: New Features and Capabilities
Acquia Platform Update: New Features and CapabilitiesAcquia Platform Update: New Features and Capabilities
Acquia Platform Update: New Features and Capabilities
 

Recently uploaded

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
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
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
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.
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
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
 
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
 
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
 
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
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 

Recently uploaded (20)

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
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...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
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...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
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
 
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...
 
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
 
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
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 

Micro frontends Web component approach con VUEJS

  • 1. Micro Frontends Web component approach con VUEJS ANDREA CAMPACI | IT ARCHITECT WORKSHOP
  • 2. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 2 🙏
  • 3. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI Andrea Campaci IT Architect @ Banca Mediolanum S.p.A. //andreacampaci.it info@andreacampaci.it 3
  • 4. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 4 Contenuti del workshop Architettura 01 Web components 02 Facciamo pratica 04 Q&A 05 Vue CLI 03
  • 5. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 5 Repository di riferimento $ git checkout workshop $ npm run bootstrap Enjoy!! andreacampaci/micro-fe-vue2-wc
  • 6. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 01 Architettura 6
  • 7. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI Application 7 01 Architettura The Monolith Frontend Backend Frontend Aggregation Layer Microservice Microservice Microservice Front & Back Microservices
  • 8. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI Micro Frontends Overview L’idea del pattern nasce dalla necessità di far realizzare a team indipendenti funzionalità business e2e. Team PRJ Z Es. product list, create, edit, delete Team PRJ Y Es. user login and registration Team PRJ X Es. cart fn, add & remove item, buy wizard Frontend Backend Database 8 01 Architettura
  • 9. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 9 01 Architettura Driver Principali Resilienza Performance Scalabilità Unlock • Utilizzo di più framework. • Ideale per chi vuole migrare la propria architettura verso un altro framework, prevenendo l’obsolescenza del software. • Team con know how tecnologici differenti possono collaborare alla produzione di componenti software per un unico progetto. • Parallelizzazione delle attività di sviluppo. • Ogni micro app viene sviluppata, testata, rilasciata separatamente. • Ogni micro applicazione FE ha un bundle estremamente piccolo, ottimizzabile ulteriormente utilizzando il code splitting. • Alcuni file vendor possono essere esternalizzati per poi essere condivisi univocamente. • Seguendo il principio CCP (Common Closure Principle), ogni componente software è auto- consistente e responsabile di un solo dominio. • Ogni micro applicazione gestisce il proprio error handling senza bloccare le altre in pagina.
  • 10. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI SUB-DOMAIN HTML FRAGMENTS WEB COMPONENT IFRAME • Standard HTML • Reattività • Isolamento CSS • Necessita di polyfill in IE11 • Forte isolamento • Poca comunicazione • Performance • CORS issues • Scomposizione • Nessuno standard presente • CSS presente in pagina 10 01 Architettura Differenti approcci • Nessuna comunicazione • Forte isolamento
  • 11. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI PRESENTATION LAYER PORTAL 11 01 Architettura Architettura logica AGGREGATION LAYER WIDGET BFF WIDGET WIDGET BUSINESS LAYER WIDGET MICROSERVICES DATA LAYER DATA
  • 12. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 12 01 Architettura Principi di responsabilità Portale (Shell) • Carica • Orchestra • Compone • Naviga • Autentica Widget • Business • Business • Business PRESENTATION LAYER PORTAL WIDGET WIDGET
  • 13. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 13 01 Architettura Componenti a fattor comune PRESENTATION LAYER UI Library Framework Event Broker Nav Utils Http Service Handler Error PORTAL WIDGET WIDGET
  • 14. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 14 01 Architettura Comunicazione tra widget Widget A Widget B Portal Event Bus subscribe dispatch(data) data custom event (data) data Broker
  • 15. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 02 Web components 15
  • 16. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI Cosa sono? Componenti create con diverse librerie/framework, le cui funzionalità sono incapsulate rispetto al codice presente in pagina e possono essere riutilizzate in differenti applicazioni web. 16 02 Web components
  • 17. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 17 02 Web components Librerie e framework
  • 18. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 18 Principali proprietà Custom elements ESM (Moduli) Shadow DOM CSS Scope Il CSS viene isolato dall’esterno in modo che l’applicazione resti consistente indipendente dal contesto. Un aspetto importante dei Web Component è l'incapsulamento: essere in grado di mantenere la struttura, lo stile e il comportamento separato da altro codice nella pagina. I moduli JS sono la base della tecnologia web component. Questa funzionalità introdotta da JS permette di importare ed esportare codice JS in moduli rendendo riutilizzabile il codice in altre applicazioni. I Custom Elements permettono di creare elementi HTML (Tags) nativi che possono implementare da una singola funzionalità ad un intera applicazione. Lo scopo di tali elementi è essere riutilizzabili. 02 Web components
  • 19. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 19 Struttura logica 02 Web components Documento HTML Custom Element Shadow DOM APP
  • 20. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 20 Supporto Browsers 02 Web components ✓ ✓ ✓ ✓ ✓ ✘
  • 21. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 03 Vue CLI 21
  • 22. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 22 03 Vue CLI Creazione del componente $ vue-cli-service build --target wc $ vue create [widget-name] La creazione di un nuovo progetto avviene tramite CLI con il seguente comando: Una volta che l’applicazione è completata, accodare al comando di build l’attributo “target” dal valore Web Component
  • 23. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 23 03 Vue CLI Proprietà in input L’injection di dati dall’esterno avvengono tramite data-binding; Sfruttando quindi le proprietà del componente principale Vue (App.vue) possiamo definire quali sono i dati che possiamo passare in input al nostro Web Component.
  • 24. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 24 03 Vue CLI Dispatch di eventi Allo stesso modo delle proprietà, ogni evento lanciato dal componente principale (App.vue) viene automaticamente trasformato in un Custom Event. L’evento pubblicato potrà essere ascoltato sul Custom Element. this.$emit(“event-name”, data)
  • 25. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 25 03 Vue CLI Caricamento da una Shell Static Lazy Documento HTML Documento HTML app1.js app2.js SHELL app1.js app2.js Widget 1 app1.js Widget 1 SHELL
  • 26. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 04 Facciamo pratica 26
  • 27. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI DOC HTML DOC HTML DOC HTML DOC HTML DOC HTML DOC HTML DOC HTML DOC HTML 27 04 Facciamo pratica DOC HTML SHELL Home tab Todo List tab WIDGET 1 WIDGET 2 WIDGET LIST WIDGET FORM DOC HTML Struttura del progetto Creeremo un applicazione nella quale saranno presenti due tab “Home” e “Todo list”. Entrambe le pagine ospiteranno due widget diversi tra loro caricati in maniera Lazy.
  • 28. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI 28 Q&A
  • 29. MICRO FRONTENDS WORKSHOP | ANDREA CAMPACI Thank " 29 info@andreacampaci.it