Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Vamos Falar Sobre Micro Frontends
Search
Nélio Frazão
March 12, 2020
Technology
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Vamos Falar Sobre Micro Frontends
Talk apresentada no 8° Meet-up do Paraíba JS
Nélio Frazão
March 12, 2020
More Decks by Nélio Frazão
See All by Nélio Frazão
Trabalhando com Arrays e Objetos
neliofrazao
0
33
Aula de introdução a JS
neliofrazao
0
42
Vamos falar sobre TDD
neliofrazao
0
23
Other Decks in Technology
See All in Technology
Rustuna: Rustによる高速なOptuna実装
pfn
PRO
0
190
しろおびから始める!ログ活用の第一歩
shumei_ito
0
950
JAWSUG TOHOKU 青森支部 「LoGoチャット」のAWS移行で 乗り越えたこと
taketakekaho
0
330
「事実」を「計測」して、「解釈」する 〜AWS Lambdaのメモリ最適解の見つけ方〜
maimyyym
0
170
PHPカンファレンス関西の招待状 / Invitation to PHP Conference Kansai
ykanoh
0
130
Active Record Connection Adaptersにおける長年の課題に再び取り組む
yahonda
0
150
ストレスなくAIと付き合いたい!こんなときどうしてる?
namiki64
3
540
WasmをRustにする
sansantech
PRO
0
250
hackers_champloo_2026_tidb
makocchi
0
160
その Valkey 使いこなしていますか?
onk
PRO
5
1.5k
LambdaWebFunctionsを試してみた / exploring-lambda-web-functions
koukihosaka
1
340
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
770
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
The Invisible Side of Design
smashingmag
301
52k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Designing for Timeless Needs
cassininazir
1
530
Bash Introduction
62gerente
615
220k
Practical Orchestrator
shlominoach
192
12k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
640
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
570
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
440
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
410
Side Projects
sachag
456
43k
Transcript
VAMOS FALAR SOBRE MICRO FRONTEND Palestrante: Nélio Frazão Email:
[email protected]
SOBRE NÉLIO Nélio Frazão, Frontend, com 12 anos de experiência.
Possui MBA em Marketing Digital, pela Faculdade Estácio/Idez em /João Pessoa/PB. e especialista em Desenvolvimento de Aplicações para WEB pelo UNIPÊ
ENTENDENDO O PROBLEMA SPA (MONOLITO) DB Backend (MONOLITO) A P
I G A T W A Y
DESVANTAGENS MONOLITO Baixa Escalabilidade Falta de Flexibilidade Code Base Gigante
Complexidade Preso a uma única tecnologia. Exige que todo o sistema seja replicado. Quanto maior o sistema, maior é a base de código. Dificuldade nas entregas contínuas.
MICRO SPA (MONOLITO) DB CHECKOUT SERVICE A P I G
A T W A Y DB CATALOG SERVICE
E SE O FRONT END...
MICRO FRONT END CHECKOUT FRONT END DB CHECKOUT SERVICE A
P I G A T W A Y DB CATALOG SERVICE CATALOG FRONT END B A S E A P P
MICRO FRONT END Base APP
DEFININDO MICRO FRONTEND Um estilo de arquitetura onde podem ser
feitas entregas independentes de fragmentos de frontend que compõem uma aplicação maior.
VANTAGENS MICRO FRONTEND DEPLOY INDEPENDENTE UPGRADES INCREMENTAIS MÚLTIPLAS TECNOLOGIAS TIMES
AUTONOMOS
O QUE DEVEMOS ESPERAR DE UM MICRO FRONTEND? AGNÓSTICO DE
TECNOLOGIA ISOLAR CÓDIGO DA EQUIPE DEPLOY INDEPENDENTE CONVENÇÕES DE TRABALHO
IMPLEMENTAÇÃO BUILD-TIME COMPOSITION RUN-TIME COMPOSITION VS
BUILD-TIME COMPOSITION CHECKOUT FRONT END CATALOG FRONT END Base APP
PACKAGE REGISTRY
BUILD-TIME INTEGRATION { "name": "@ecommerce/container" , "version": "1.0.0", "description": "some
ecommerce app" , "dependencies": { "@ecommerce/checkout": "^1.2.3", "@ecommerce/catalog": "^4.5.6", } }
BUILD-TIME COMPOSITION Bundles Independentes Times separados por contexto Arquitetura monolítica
para diferentes times Sem deploys independentes
RUN-TIME COMPOSITION CHECKOUT FRONT END CATALOG FRONT END BASE APP
BUILD-TIME COMPOSITION Times independentes Deploys indepentes Pode haver muitas requisições
no lado do usuário
SERVER-SIDE TEMPLATE COMPOSITION USER'S BROWSER SERVICE 2 N G I
N X CONTAINER APP SERVER SERVICE 1 <esi:include src="include/service1" />
SERVER-SIDE TEMPLATE COMPOSITION <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title>Feed
me</title> </head> <body> <h1> Feed me</h1> <esi:include src="/order" /> </body> </html> server { listen 8080; server_name localhost; root /usr/share/nginx/html; index index.html; ssi on; rewrite ^/$ http:/ /localhost:8080/browse redirect; location /browse { set $PAGE 'browse'; } location /order { set $PAGE 'order'; } location /profile { set $PAGE 'profile' } error_page 404 /index.html; } variável $PAGE guarda a URL que está sendo solicitado:
RUN-TIME INTEGRATION VIA IFRAMES <iframe src="http:/ /micro2.com"/> <iframe src="http:/micro3.com"/> <iframe
src="http:/ /www.micro1.com"/>
RUN-TIME INTEGRATION VIA WEB COMPONENTS MICRO-APP2 MICRO-APP3 MICRO-APP1
<h1>Welcome to Feed me!</h1> <script src="https:/ /browse.example.com/bundle.js"></script> <script src="https:/ /order.example.com/bundle.js"></script>
<script src="https:/ /profile.example.com/bundle.js"></script> <div id="micro-frontend-root"></div> <script type="text/javascript"> const webComponentsByRoute = { '/': 'micro-frontend-browse-restaurants', '/order-food': 'micro-frontend-order-food', '/user-profile': 'micro-frontend-user-profile', }; const webComponentType = webComponentsByRoute[window.location.pathname]; const root = document.getElementById('micro-frontend-root'); const webComponent = document.createElement(webComponentType); root.appendChild(webComponent); </script> EXEMPLO
SINGLE-SPA BOOTSTRAP MOUNT( ) UNMOUNT( )
COMPARTILHANDO DADOS
PROPS <ContainerApp className={classes.root}> <Product item={this.props.selectedItem} /> <ProductReview item={this.props.selectedItem} /> </ContainerApp>
STATE MANAGEMENT TOOLS
DOM EVENTS let event = new Event(click) elem.dispatchEvent(event) elem.addEventListener(click, e
=> { /* code */}, false ) DISPATCH O EVENTO ESCUTA O EVENTO
DESIGN DESIGN
TESTS TESTS
CONSIDERAÇÕES FINAIS CONSIDERAÇÕES FINAIS
OBRIGADO
[email protected]
http:/ /www.linkedin.com/in/neliofrazao