SlideShare a Scribd company logo
1 of 28
MICRO FRONT-ENDS
Ori Calvo
Trainologic
2
Technology evolves quickly
 Backbone, Knockout, Ember, Meteor, AngularJS …
 React, Angular, VueJS …
 We can build awesome apps with AngularJS
 Would you join a company that only uses AngularJS ?
3
Front-end gets bigger
 Migrating to latest technology stacks takes time
 The big bang approach is not practical
4
End-to-End teams
 VS. technical teams
 Each team delivers separately
 Each team has its own opinion …
5
Micro Front-Ends Approach
“Recipes for building a web app with multiple teams using
different JavaScript frameworks”
https://micro-frontends.org/
Michael Geers
6
Who am I
 Ori Calvo
 Head of Front end technologies @ Trainologic
 Over 20 years of development/leading experience
 Manager of the WDCIL Meetup group
 Owner of the extremely popular t-rex library
7
Tomorrow Seminar
 Building Reusable Web Components
 Gil Fink
8
Recipes
 Multiple SPAs at different URLs
 Web components
 IFrames
 Shared event bus
 Layout service
 The single-spa framework
9
Multi SPAs
 Each SPA lives in its own URL
 Probably the easiest solution 
 Not so great UX 
 Use a reverse proxy to simplify navigation
10
Multi SPAs - DEMO
 window.open
 Set a gateway
 Shared app store
 Shared API
11
Multi SPAs - More
 Shared infra can be moved to a dedicated NPM package
 Can use window.opener to share state & API
 Switching between existing tabs is tricky
 Many opened tabs  Performance issues
12
single-spa Meta-framework
 Hosts multiple applications inside single SPA
 Implements a cross application router
 Only one active at a time
 Each application is associated with a router prefix
 Each application must support: bootstrap, mount, unmount
13
single-spa DEMO
14
index.html
<body>
<script src="/dist/common-dependencies.js"></script>
<script src="/dist/root-application.js"></script>
<div class="navbar">
<ul>
<a onclick="singleSpaNavigate('/app1')"><li>App 1</li></a>
<a onclick="singleSpaNavigate('/app2')"><li>App 2</li></a>
</ul>
</div>
<div class="app1"></div>
<div class="app2"></div>
</body>
15
Root App
import * as singleSpa from 'single-spa';
singleSpa.registerApplication('app1',
() => import ('./app1/main.js'),
location => location.pathname.startsWith(`/app1`));
singleSpa.registerApplication('app2',
() => import ('./app2/main.js'),
location => location.pathname.startsWith(`/app2`));
singleSpa.start();
16
React
const reactLifecycles = singleSpaReact({
React,
ReactDOM,
rootComponent: Root,
domElementGetter: () => document.querySelector("body > .app1"),
});
export function bootstrap(props) {
return reactLifecycles.bootstrap(props);
}
export function mount(props) {
return reactLifecycles.mount(props);
}
export function unmount(props) {
return reactLifecycles.unmount(props);
}
17
Angular
const ngLifecycles = singleSpaAngular({
domElementGetter: () => document.querySelector("body > .app2"),
mainModule: AppModule,
angularPlatform: platformBrowserDynamic(),
template: `<app-root></app-root>`,
})
export function bootstrap(props) {
return ngLifecycles.bootstrap(props);
}
export function mount(props) {
return ngLifecycles.mount(props);
}
export function unmount(props) {
return ngLifecycles.unmount(props);
}
18
single-spa
 All major FX are supported
 Does not help with component interaction
 Need to manually configure a webpack build
 Use React/Angular eject
 Mounting & unmounting are heavy operations
19
The Web Components Standard
 HTML imports
 HTML templates
 Custom elements
 Shadow DOM
20
Custom Element
class MyClock extends HTMLElement {
constructor() {
super();
}
connectedCallback() {
this.innerText = new Date();
}
}
customElements.define('my-clock', MyClock);
21
Custom Element
 DEMO
22
Web Components
 Maintain a single SPA
 Use custom elements as integration layer
 Each component is wrapped inside a custom element
 Internally you may use whatever FX you want
23
Web Components
 DEMO
24
Web Components
 Probably another wrapper is required
 Per host application type 
 Custom element supports attributeChangedCallback
 However, attribute must be a string
 Versioning
 Loading two React/Angular instances is tricky
 Stencil
 Angular Elements
25
IFrames
 Quite similar to the “Multi SPA” approach
 Allows for component interaction
 Over application interaction
 However,
 Scrollbar is a nightmare
 CSS does not cascade easily
 Cannot nest too much
 Bundle size
26
Layout Service
 Project Mosaic at https://www.mosaic9.org/
 Offers Tailor layout service
 Composing a website out of various Fragments
 Inspired by Facebook’s BigPipe
27
Summary
 Lots of recipes and small tools
 No significant leader
 single-spa is probably the most famous
 Should resemble the organization layout
THANK YOU
Ori Calvo
Trainologic

More Related Content

What's hot

Full Stack Reactive with React and Spring WebFlux - SpringOne 2018
Full Stack Reactive with React and Spring WebFlux - SpringOne 2018Full Stack Reactive with React and Spring WebFlux - SpringOne 2018
Full Stack Reactive with React and Spring WebFlux - SpringOne 2018Matt Raible
 
Fastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS AppsFastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS AppsSarath C
 
Vietnam qa meetup
Vietnam qa meetupVietnam qa meetup
Vietnam qa meetupSyam Sasi
 
Bootiful Development with Spring Boot and Angular - Connect.Tech 2017
 Bootiful Development with Spring Boot and Angular - Connect.Tech 2017 Bootiful Development with Spring Boot and Angular - Connect.Tech 2017
Bootiful Development with Spring Boot and Angular - Connect.Tech 2017Matt Raible
 
React Native Androidはなぜ動くのか
React Native Androidはなぜ動くのかReact Native Androidはなぜ動くのか
React Native Androidはなぜ動くのかYukiya Nakagawa
 
Bootiful Development with Spring Boot and Angular - Spring I/O 2017
Bootiful Development with Spring Boot and Angular - Spring I/O 2017Bootiful Development with Spring Boot and Angular - Spring I/O 2017
Bootiful Development with Spring Boot and Angular - Spring I/O 2017Matt Raible
 
MDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation TestMDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation TestMasud Parvez
 
Using JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsYakov Fain
 
Deploy your app with one Slack command
Deploy your app with one Slack commandDeploy your app with one Slack command
Deploy your app with one Slack commandFabio Milano
 
Connecting Connect with Spring Boot
Connecting Connect with Spring BootConnecting Connect with Spring Boot
Connecting Connect with Spring BootVincent Kok
 
HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP
HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSPHKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP
HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSPLinaro
 
Microservices for the Masses with Spring Boot and JHipster - RWX 2018
Microservices for the Masses with Spring Boot and JHipster - RWX 2018Microservices for the Masses with Spring Boot and JHipster - RWX 2018
Microservices for the Masses with Spring Boot and JHipster - RWX 2018Matt Raible
 
Meteor presentation
Meteor presentationMeteor presentation
Meteor presentationscandiweb
 
Introduction to Redux (for Angular and React devs)
Introduction to Redux (for Angular and React devs)Introduction to Redux (for Angular and React devs)
Introduction to Redux (for Angular and React devs)Fabio Biondi
 
Eclipse Buildship JUG Hamburg
Eclipse Buildship JUG HamburgEclipse Buildship JUG Hamburg
Eclipse Buildship JUG Hamburgsimonscholz
 

What's hot (20)

Full Stack Reactive with React and Spring WebFlux - SpringOne 2018
Full Stack Reactive with React and Spring WebFlux - SpringOne 2018Full Stack Reactive with React and Spring WebFlux - SpringOne 2018
Full Stack Reactive with React and Spring WebFlux - SpringOne 2018
 
Fastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS AppsFastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS Apps
 
Vietnam qa meetup
Vietnam qa meetupVietnam qa meetup
Vietnam qa meetup
 
Bootiful Development with Spring Boot and Angular - Connect.Tech 2017
 Bootiful Development with Spring Boot and Angular - Connect.Tech 2017 Bootiful Development with Spring Boot and Angular - Connect.Tech 2017
Bootiful Development with Spring Boot and Angular - Connect.Tech 2017
 
React Native Androidはなぜ動くのか
React Native Androidはなぜ動くのかReact Native Androidはなぜ動くのか
React Native Androidはなぜ動くのか
 
React Native
React NativeReact Native
React Native
 
Understanding meteor
Understanding meteorUnderstanding meteor
Understanding meteor
 
Spring Boot Intro
Spring Boot IntroSpring Boot Intro
Spring Boot Intro
 
Sst hackathon express
Sst hackathon expressSst hackathon express
Sst hackathon express
 
Bootiful Development with Spring Boot and Angular - Spring I/O 2017
Bootiful Development with Spring Boot and Angular - Spring I/O 2017Bootiful Development with Spring Boot and Angular - Spring I/O 2017
Bootiful Development with Spring Boot and Angular - Spring I/O 2017
 
MDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation TestMDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation Test
 
Using JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot apps
 
Deploy your app with one Slack command
Deploy your app with one Slack commandDeploy your app with one Slack command
Deploy your app with one Slack command
 
React Native Expo
React Native ExpoReact Native Expo
React Native Expo
 
Connecting Connect with Spring Boot
Connecting Connect with Spring BootConnecting Connect with Spring Boot
Connecting Connect with Spring Boot
 
HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP
HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSPHKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP
HKG15-306: Introducing Aster - a tool for remote GUI testing on AOSP
 
Microservices for the Masses with Spring Boot and JHipster - RWX 2018
Microservices for the Masses with Spring Boot and JHipster - RWX 2018Microservices for the Masses with Spring Boot and JHipster - RWX 2018
Microservices for the Masses with Spring Boot and JHipster - RWX 2018
 
Meteor presentation
Meteor presentationMeteor presentation
Meteor presentation
 
Introduction to Redux (for Angular and React devs)
Introduction to Redux (for Angular and React devs)Introduction to Redux (for Angular and React devs)
Introduction to Redux (for Angular and React devs)
 
Eclipse Buildship JUG Hamburg
Eclipse Buildship JUG HamburgEclipse Buildship JUG Hamburg
Eclipse Buildship JUG Hamburg
 

Similar to Micro Front-Ends

Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...Codemotion
 
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...Luciano Mammino
 
How To Integrate Native Android App With React Native.
How To Integrate Native Android App With React Native.How To Integrate Native Android App With React Native.
How To Integrate Native Android App With React Native.Techugo
 
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigiReact Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigiYukiya Nakagawa
 
A Story about AngularJS modularization development
A Story about AngularJS modularization developmentA Story about AngularJS modularization development
A Story about AngularJS modularization developmentJohannes Weber
 
Introducing Applitude: Simple Module Management
Introducing Applitude: Simple Module ManagementIntroducing Applitude: Simple Module Management
Introducing Applitude: Simple Module ManagementEric Hamilton
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteorSapna Upreti
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsMatteo Manchi
 
MunichJS - node.js - from the beginning
MunichJS - node.js - from the beginningMunichJS - node.js - from the beginning
MunichJS - node.js - from the beginningRobert Prediger
 
Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6William Marques
 
Modern JavaScript, without giving up on Rails
Modern JavaScript, without giving up on RailsModern JavaScript, without giving up on Rails
Modern JavaScript, without giving up on RailsJonathan Johnson
 
Containers & Dependency in Ember.js
Containers & Dependency in Ember.jsContainers & Dependency in Ember.js
Containers & Dependency in Ember.jsMatthew Beale
 
Using Jhipster 4 for Generating Angular/Spring Boot Apps
Using Jhipster 4 for Generating Angular/Spring Boot AppsUsing Jhipster 4 for Generating Angular/Spring Boot Apps
Using Jhipster 4 for Generating Angular/Spring Boot AppsVMware Tanzu
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]GDSC UofT Mississauga
 
End to end todo list app with NestJs - Angular - Redux & Redux Saga
End to end todo list app with NestJs - Angular - Redux & Redux SagaEnd to end todo list app with NestJs - Angular - Redux & Redux Saga
End to end todo list app with NestJs - Angular - Redux & Redux SagaBabacar NIANG
 
Workshop 26: React Native - The Native Side
Workshop 26: React Native - The Native SideWorkshop 26: React Native - The Native Side
Workshop 26: React Native - The Native SideVisual Engineering
 

Similar to Micro Front-Ends (20)

Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...
 
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
 
How To Integrate Native Android App With React Native.
How To Integrate Native Android App With React Native.How To Integrate Native Android App With React Native.
How To Integrate Native Android App With React Native.
 
React django
React djangoReact django
React django
 
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigiReact Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
 
A Story about AngularJS modularization development
A Story about AngularJS modularization developmentA Story about AngularJS modularization development
A Story about AngularJS modularization development
 
Introducing Applitude: Simple Module Management
Introducing Applitude: Simple Module ManagementIntroducing Applitude: Simple Module Management
Introducing Applitude: Simple Module Management
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteor
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applications
 
MunichJS - node.js - from the beginning
MunichJS - node.js - from the beginningMunichJS - node.js - from the beginning
MunichJS - node.js - from the beginning
 
Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6
 
React Native
React NativeReact Native
React Native
 
Modern JavaScript, without giving up on Rails
Modern JavaScript, without giving up on RailsModern JavaScript, without giving up on Rails
Modern JavaScript, without giving up on Rails
 
Containers & Dependency in Ember.js
Containers & Dependency in Ember.jsContainers & Dependency in Ember.js
Containers & Dependency in Ember.js
 
Using Jhipster 4 for Generating Angular/Spring Boot Apps
Using Jhipster 4 for Generating Angular/Spring Boot AppsUsing Jhipster 4 for Generating Angular/Spring Boot Apps
Using Jhipster 4 for Generating Angular/Spring Boot Apps
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
 
End to end todo list app with NestJs - Angular - Redux & Redux Saga
End to end todo list app with NestJs - Angular - Redux & Redux SagaEnd to end todo list app with NestJs - Angular - Redux & Redux Saga
End to end todo list app with NestJs - Angular - Redux & Redux Saga
 
React native
React nativeReact native
React native
 
jsDay 2016 recap
jsDay 2016 recapjsDay 2016 recap
jsDay 2016 recap
 
Workshop 26: React Native - The Native Side
Workshop 26: React Native - The Native SideWorkshop 26: React Native - The Native Side
Workshop 26: React Native - The Native Side
 

Recently uploaded

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
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
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
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
 
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
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
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
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 

Recently uploaded (20)

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
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...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
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
 
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...
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
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
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 

Micro Front-Ends

  • 2. 2 Technology evolves quickly  Backbone, Knockout, Ember, Meteor, AngularJS …  React, Angular, VueJS …  We can build awesome apps with AngularJS  Would you join a company that only uses AngularJS ?
  • 3. 3 Front-end gets bigger  Migrating to latest technology stacks takes time  The big bang approach is not practical
  • 4. 4 End-to-End teams  VS. technical teams  Each team delivers separately  Each team has its own opinion …
  • 5. 5 Micro Front-Ends Approach “Recipes for building a web app with multiple teams using different JavaScript frameworks” https://micro-frontends.org/ Michael Geers
  • 6. 6 Who am I  Ori Calvo  Head of Front end technologies @ Trainologic  Over 20 years of development/leading experience  Manager of the WDCIL Meetup group  Owner of the extremely popular t-rex library
  • 7. 7 Tomorrow Seminar  Building Reusable Web Components  Gil Fink
  • 8. 8 Recipes  Multiple SPAs at different URLs  Web components  IFrames  Shared event bus  Layout service  The single-spa framework
  • 9. 9 Multi SPAs  Each SPA lives in its own URL  Probably the easiest solution   Not so great UX   Use a reverse proxy to simplify navigation
  • 10. 10 Multi SPAs - DEMO  window.open  Set a gateway  Shared app store  Shared API
  • 11. 11 Multi SPAs - More  Shared infra can be moved to a dedicated NPM package  Can use window.opener to share state & API  Switching between existing tabs is tricky  Many opened tabs  Performance issues
  • 12. 12 single-spa Meta-framework  Hosts multiple applications inside single SPA  Implements a cross application router  Only one active at a time  Each application is associated with a router prefix  Each application must support: bootstrap, mount, unmount
  • 14. 14 index.html <body> <script src="/dist/common-dependencies.js"></script> <script src="/dist/root-application.js"></script> <div class="navbar"> <ul> <a onclick="singleSpaNavigate('/app1')"><li>App 1</li></a> <a onclick="singleSpaNavigate('/app2')"><li>App 2</li></a> </ul> </div> <div class="app1"></div> <div class="app2"></div> </body>
  • 15. 15 Root App import * as singleSpa from 'single-spa'; singleSpa.registerApplication('app1', () => import ('./app1/main.js'), location => location.pathname.startsWith(`/app1`)); singleSpa.registerApplication('app2', () => import ('./app2/main.js'), location => location.pathname.startsWith(`/app2`)); singleSpa.start();
  • 16. 16 React const reactLifecycles = singleSpaReact({ React, ReactDOM, rootComponent: Root, domElementGetter: () => document.querySelector("body > .app1"), }); export function bootstrap(props) { return reactLifecycles.bootstrap(props); } export function mount(props) { return reactLifecycles.mount(props); } export function unmount(props) { return reactLifecycles.unmount(props); }
  • 17. 17 Angular const ngLifecycles = singleSpaAngular({ domElementGetter: () => document.querySelector("body > .app2"), mainModule: AppModule, angularPlatform: platformBrowserDynamic(), template: `<app-root></app-root>`, }) export function bootstrap(props) { return ngLifecycles.bootstrap(props); } export function mount(props) { return ngLifecycles.mount(props); } export function unmount(props) { return ngLifecycles.unmount(props); }
  • 18. 18 single-spa  All major FX are supported  Does not help with component interaction  Need to manually configure a webpack build  Use React/Angular eject  Mounting & unmounting are heavy operations
  • 19. 19 The Web Components Standard  HTML imports  HTML templates  Custom elements  Shadow DOM
  • 20. 20 Custom Element class MyClock extends HTMLElement { constructor() { super(); } connectedCallback() { this.innerText = new Date(); } } customElements.define('my-clock', MyClock);
  • 22. 22 Web Components  Maintain a single SPA  Use custom elements as integration layer  Each component is wrapped inside a custom element  Internally you may use whatever FX you want
  • 24. 24 Web Components  Probably another wrapper is required  Per host application type   Custom element supports attributeChangedCallback  However, attribute must be a string  Versioning  Loading two React/Angular instances is tricky  Stencil  Angular Elements
  • 25. 25 IFrames  Quite similar to the “Multi SPA” approach  Allows for component interaction  Over application interaction  However,  Scrollbar is a nightmare  CSS does not cascade easily  Cannot nest too much  Bundle size
  • 26. 26 Layout Service  Project Mosaic at https://www.mosaic9.org/  Offers Tailor layout service  Composing a website out of various Fragments  Inspired by Facebook’s BigPipe
  • 27. 27 Summary  Lots of recipes and small tools  No significant leader  single-spa is probably the most famous  Should resemble the organization layout