SlideShare a Scribd company logo
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 2018
Matt 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 Apps
Sarath C
 
Vietnam qa meetup
Vietnam qa meetupVietnam qa meetup
Vietnam qa meetup
Syam 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 2017
Matt Raible
 
React Native Androidはなぜ動くのか
React Native Androidはなぜ動くのかReact Native Androidはなぜ動くのか
React Native Androidはなぜ動くのか
Yukiya Nakagawa
 
React Native
React NativeReact Native
React Native
Fatih Şimşek
 
Understanding meteor
Understanding meteorUnderstanding meteor
Understanding meteor
M A Hossain Tonu
 
Spring Boot Intro
Spring Boot IntroSpring Boot Intro
Spring Boot Intro
Alberto Flores
 
Sst hackathon express
Sst hackathon expressSst hackathon express
Sst hackathon express
Aeshan Wijetunge
 
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
Matt Raible
 
MDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation TestMDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation Test
Masud 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 apps
Yakov 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 command
Fabio Milano
 
React Native Expo
React Native ExpoReact Native Expo
React Native Expo
Ryosuke Hara
 
Connecting Connect with Spring Boot
Connecting Connect with Spring BootConnecting Connect with Spring Boot
Connecting Connect with Spring Boot
Vincent 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 AOSP
Linaro
 
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
Matt Raible
 
Meteor presentation
Meteor presentationMeteor presentation
Meteor presentation
scandiweb
 
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 Hamburg
simonscholz
 

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 django
React djangoReact django
React django
Heber Silva
 
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigiReact Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
Yukiya Nakagawa
 
A Story about AngularJS modularization development
A Story about AngularJS modularization developmentA Story about AngularJS modularization development
A Story about AngularJS modularization development
Johannes Weber
 
Introducing Applitude: Simple Module Management
Introducing Applitude: Simple Module ManagementIntroducing Applitude: Simple Module Management
Introducing Applitude: Simple Module Management
Eric Hamilton
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteor
Sapna 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 applications
Matteo Manchi
 
MunichJS - node.js - from the beginning
MunichJS - node.js - from the beginningMunichJS - node.js - from the beginning
MunichJS - node.js - from the beginning
Robert Prediger
 
Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6
William Marques
 
React Native
React NativeReact Native
React Native
Craig Jolicoeur
 
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
Jonathan Johnson
 
Containers & Dependency in Ember.js
Containers & Dependency in Ember.jsContainers & Dependency in Ember.js
Containers & Dependency in Ember.js
Matthew 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 Apps
VMware 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 Saga
Babacar NIANG
 
React native
React nativeReact native
jsDay 2016 recap
jsDay 2016 recapjsDay 2016 recap
jsDay 2016 recap
Giorgio Cefaro
 
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
Visual 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

8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
Karya Keeper
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
NishanthaBulumulla1
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 

Recently uploaded (20)

8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 

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