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
Natura Meet Up PWA - Offline first
Search
Marcus Ortense
September 12, 2019
Programming
82
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Natura Meet Up PWA - Offline first
Marcus Ortense
September 12, 2019
More Decks by Marcus Ortense
See All by Marcus Ortense
Analytics para Devs
ortense
1
99
Concrete on Beer JavaScript - Offline first
ortense
0
140
Escrevendo javascript testável
ortense
1
170
Serverless
ortense
0
87
Talk - let, const & arrow functions
ortense
0
71
Talk - JavaScript Isomórfico
ortense
0
87
Desenvolvimento vs Conversão
ortense
2
110
Other Decks in Programming
See All in Programming
contenteditable と日本語入力に向き合う
colorful12
0
210
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
300
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
160
ジョジョの世界をXRで再現する
mofurune
0
180
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
360
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
300
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
820
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
190
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.3k
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.7k
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
3
1.1k
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
190
Featured
See All Featured
Being A Developer After 40
akosma
PRO
92
590k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
310
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
How to make the Groovebox
asonas
2
2.5k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
360
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Transcript
– OFFLINE FIRST meetup
Chapter Manager @ Concrete
Tech Lead @ Social Selling
– OFFLINE FIRST meetup Por que isso é importante?
– Qual a realidade da internet hoje?
– 40% dos usuários abandonam o site após 3 segundos
de espera. fonte: Dynatrace / Gomez.com (http://bit.ly/29jzPRc)
– Amazon identificou que cada 100 milissegundos de espera representa
a queda de 1% nas vendas fonte: Amazon / Findory (http://bit.ly/2kd4UOp)
– Em 2019 a cobertura de 3G no Brasil chegou
a 97.6%, atingindo 5438 municípios. fonte: Operadoras (http://bit.ly/2kaUSNC)
– 33% dos brasileiros acessa a internet apenas por dispositivos
móveis fonte: IBGE (http://bit.ly/2k8rFTs)
– 76% dos brasileiros utiliza banda larga móvel, sendo que
17% não possui acesso a outro tipo de conexão. fonte: IBGE (http://bit.ly/2k8rFTs)
– Brasil ocupa a 50ª posição no ranking de velocidade
de internet móvel. fonte: IBGE (http://bit.ly/2k8rFTs)
– A média de velocidade de internet móvel no Brasil
é 13mbs, abaixo da média global de 17mbs. fonte: IBGE (http://bit.ly/2k8rFTs)
– Mais de 70% dos acessos ao rede vem de
dispositivos móveis. fonte: Rede Natura
– E o que isso tem a ver com PWA?
None
None
None
– Progressive Web Apps é uma experiência do usuário ao
alcance da web confiável, rápida e engajante. fonte: Google Developers (http://bit.ly/2kI5J1J)
– Progressive Web Apps é uma experiência do usuário ao
alcance da web confiável, rápida e engajante. fonte: Google Developers (http://bit.ly/2kI5J1J)
– Carregue instantaneamente e nunca mostre o downasaur, mesmo em
condições de rede incertas. fonte: Google Developers (http://bit.ly/2kI5J1J)
– Mas como?!
– Tipo de conexão console.log(navigator.connection) NetworkInformation { downlink: 10, //
Estimativa da banda em MB/S effectiveType: '4g', // Tipo de conexão slow-2g, 2g, 3g', or 4g rtt: 0, // round-trip time em milissegundo saveData: false, // O usuário utiliza economia de dados onchange: null, // Event Handler }
– Online/Offline window.addEventListener('online', (e) => console.log('Online ')); window.addEventListener('offline', (e) =>
console.log('Offline ')); if(window.navigator.onLine) { console.log('Online ') } else { console.log('Offline ') }
– Service Workers INSTALL ACTIVATED ERROR IDLE TERMINATED FETCH /
MESSAGE fonte: Google Developers | Web Fundamentals (http://bit.ly/2kxftft)
if('serviceWorker' in navigator) { console.log('ServiceWorker é suportado neste navegador ')
} else { console.log('ServiceWorker não é suportado ') }
navigator.serviceWorker.register('assets/sw.js') .then(reg => console.info('registered ', reg)) .catch(err => console.error('error registering
', err))
navigator.serviceWorker.register('assets/sw.js') .then((reg) => { if(reg.installing) { console.log('Instalando ') } else
if(reg.waiting) { console.log('Instalado ✅') } else if(reg.active) { console.log('SeviceWorker ativo ') } })
navigator.serviceWorker.register('assets/sw.js') .then((reg) => { const sw = reg.installing reg.addEventListener('updatefound', ()
=> { sw.addEventListener('statechange', () => { console.log(`Status atualizado para ${sw.state} `) }) }) })
const PRE_CACHE_URL = [ '/index.html', '/styles/main.css', '/script/main.js' ]; self.addEventListener('install', (event)
=> { event.waitUntil(caches.open('cache-app-v1') .then((cache) => cache.addAll(PRE_CACHE_URL))) })
self.addEventListener('fetch', (event) => { event.respondWith( caches.match(event.request).then((response) => { if(response) return
response return fetch(event.request) }) ) })
event.respondWith( caches.match(event.request).then((response) => { if(response) return response return fetch(event.request) .then(response
=> { caches.open('cache-app-v1').then(cache => cache.put(event.request, response.clone())) return response }) }) .catch(() => caches.match('fallback.html')))
– CONCLUSÃO
– Offline first é possível, faz sentido, pode ser feito
hoje e cria uma a experiência mais confiável para o seu usuário.
OBRIGADO! @marcusortense
[email protected]
bit.ly/2kypFEv