Front end microservices: architectures and solution
The document discusses the use of microservices in frontend architectures, highlighting the advantages such as better scalability, faster onboarding, and deployment. It explores modern frontend solutions including in-browser frameworks like single-spa and backend-powered solutions like tailor, while also addressing the technical and non-technical challenges involved in implementing these architectures. The presentation concludes with considerations for businesses on whether to adopt microservices based on their specific needs and team capabilities.
In-browser: Single-spa github.com/CanopyTax/single-spa ● Inbrowser ● Lazy load ● Parts of one page & separate routes ● Share styles, utils, data, events etc. ● Unified lifecycle @legkoletat | Microservices in frontend: architectures and solutions
Tailor app setup "scripts":{ "start": "npm run start-fragments & node tailor.js", "install-fragment-dependencies": "lerna bootstrap", "build-fragments": "lerna run build", "start-fragments": "lerna run --parallel start", "watch-fragments": "lerna run --parallel dev" }, App1 app1.min.js assets/ Serve to tailor Single repo per app: Or in monorepo: Pipeline
25.
Single app perroute ● Easy to setup ● No direct interaction ● Transfer state ● Control styles Image from Elisabeth Engel: Break Up With Your Frontend Monolith
Widget app 1 Schema #3:App per route & iframe Widget app 2 Dashboard app Header app Separate repos, pipelines, etc Header No SPA State: via server or request params
28.
Framework + Webcomponents ● WCs in 2019 are widespread and supported ● DOM & styles can be isolated ● From apps to single components
29.
Framework + Webcomponents github.com/vuejs/vue-web-component-wrapper Example for Vue, same can be for Angular, React, Svelte, etc
30.
Glimpse of future:Portals <portal id="myPortal" src="https://www.example.com/"></portal> github.com/WICG/ Secure and seamless navigation Portal can be activated myPortal.activate({ data: [...] }); Other document (portal) listens to activation, loads data and react window.addEventListener('portalactivate', e => { let predecessor = e.adoptPredecessor(document); //etc
Pros Single Responsibility Principle Fastonboarding and adding features Ease of testing, deployment Freedom to choose technology @legkoletat | Microservices in frontend: architectures and solutions
36.
Do you reallyneed this? 1. Business profile 2. Application usage profile 3. Size of codebase 4. Infrastructure 5. Size, stablity and maturity of team