Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Progressive Web Apps Done Right
Search
Felipe Sousa
December 15, 2017
Programming
730
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Progressive Web Apps Done Right
Felipe Sousa
December 15, 2017
More Decks by Felipe Sousa
See All by Felipe Sousa
DevFest Santiago 2019 - Progressive Web Apps Done Right
felipesousa
0
400
Shared web-components with StencilJS
felipesousa
0
640
Criando aplicações componentizadas com Polymer
felipesousa
0
400
Criando aplicações componentizadas com Polymer - C4P CEJS 2017
felipesousa
1
270
Criando Aplicações Componentizadas com Polymer
felipesousa
0
140
Uma introdução a Angular 2
felipesousa
2
460
Other Decks in Programming
See All in Programming
どこまでゆるくて許されるのか
tk3fftk
0
460
act1-costs.pdf
sumedhbala
0
200
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
840
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
140
symfony/aiとlaravel/boost
77web
0
120
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
580
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
130
共通化で考えるべきは、実装より公開する型だった
codeegg
0
160
AIエージェントで 変わるAndroid開発環境
takahirom
2
470
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.8k
AI時代の仕事技芸論〜ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ(スクフェス仙台 2026バージョン)
kuranuki
0
530
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
840
Featured
See All Featured
Test your architecture with Archunit
thirion
1
2.3k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
350
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Designing for Timeless Needs
cassininazir
1
280
Optimising Largest Contentful Paint
csswizardry
37
3.8k
WENDY [Excerpt]
tessaabrams
11
38k
WCS-LA-2024
lcolladotor
0
680
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
390
Embracing the Ebb and Flow
colly
88
5.1k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
670
The Cost Of JavaScript in 2023
addyosmani
55
10k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
220
Transcript
None
felipe sousa front end developer gdg fortaleza organizer
progressive web apps @felipz_sousa done right.
progressive web apps done right. @felipz_sousa
None
None
None
None
None
* responsivity
* mobile first * responsivity
* mobile first * mobile friendly * responsivity
why experience is important?!
None
is ugly
isn’t intuitive is ugly
Experience
progressive web apps
Fast Engaging Reliable *
Fast 1.
Load instantly even in uncertain network conditions.
None
Reliable 2.
Respond quickly to user interactions with silky smooth animations and
no slow scrolling.
Engaging 3.
Feel like a natural app on the device, with an
immersive user experience.
•Instalable
•Icons/Splashscreen •Instalable
•Icons/Splashscreen •Instalable •Lightweight
•Icons/Splashscreen •Instalable •Push Notifications •Lightweight
None
None
None
None
None
PROGRESSIVE WEB APPS IS ABOUT PROVIDE A BETTER EXPERIENCE TO
YOUR USER.
Engaging Reliable Fast
Web Manifest Engaging Reliable Fast Service Worker
Service Workers
offline
Application Cache
None
<html manifest="example.appcache"> ... </html>
CACHE MANIFEST # files index.html cache.html style.css image1.png # Use
from network if available NETWORK: network.html # Fallback content FALLBACK: fallback.html
A service worker is a script that your browser runs
in the background, separate from the web page, enabling features that do not require a web page or user interaction.
* HTTPS is a requirement.
None
None
Background Sync / Push API
•Install •Register •Cache Control/Strategies •Update Cache •Listen Fetch Events
if ('serviceWorker' in navigator) { window.addEventListener('load', function() { navigator.serviceWorker.register(‘/sw.js') .then(function(registration)
{}) .catch(function(err) {}); }); }
var CACHE_NAME = ‘CACHE_NAME_1’; var urlsToCache = [ '/', ‘/style.css’,
‘/script.js’, ‘/imagem.png' ]; self.addEventListener('install', function(event) { event.waitUntil( caches.open(CACHE_NAME) .then(function(cache) { return cache.addAll(urlsToCache); }) ); });
None
None
None
None
event: fetch
self.addEventListener('fetch', function (event) { event.respondWith( caches.match(event.request) .then(response => { if(response)
return response; return fetch(event.request); }) ) });
var CACHE_NAME = ‘CACHE_NAME_1’; var urlsToCache = [ '/', ‘/style.css’,
‘/script.js’, ‘/imagem.png' ]; self.addEventListener('install', function(event) { event.waitUntil( caches.open(CACHE_NAME) .then(function(cache) { return cache.addAll(urlsToCache); }) ); }); self.addEventListener('fetch', function (event) { event.respondWith( caches.match(event.request) .then(function(response) => { if(response) return response; return fetch(event.request); }) ) });
None
None
None
Caching strategies
•Cache and Update •Cache Only •Cache, update and refresh •Embedded
fallback •Network or cache
None
•Cache and Update •Cache Only •Cache, update and refresh •Embedded
fallback •Network or cache
self.addEventListener('fetch', function(evt) { evt.respondWith(fromCache(evt.request)); evt.waitUntil( update(evt.request) .then(refresh) ); }); function
refresh(response) { return self.clients.matchAll().then(function (clients) { clients.forEach(function (client) { var message = { type: 'refresh', url: response.url, eTag: response.headers.get('ETag') }; client.postMessage(JSON.stringify(message)); }); }); }
Web Manifest
index.html <meta name="apple−mobile−web−app−capable" content="yes"> <meta name="apple−mobile−web−app−title" content="Name App"> <link rel="apple−touch−icon−precomposed"
href="path/name.png">
The web application manifest is a JSON file that lets
you control how the web application or website is displayed to the user in areas that are typically expected to see native applications.
None
None
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF−8"> <title>My Page</title> <!−−
manifest −−> <link rel="manifest" src="/manifest.json"> </head> <body> </body> </html>
{ "short_name": “Application Name”, "name": “Application Full Name", "icons": [
{ "src": "launcher−icon−4x.png", "sizes": "192x192", "type": "image/png" } ], "start_url": "/index.html", "display": “standalone", "theme_color": "#77D48A", "background_color": "#E4B0AC" }
{ "short_name": “Application Name”, "name": “Application Full Name", "icons": [
{ "src": "launcher−icon−4x.png", "sizes": "192x192", "type": "image/png" } ], "start_url": "/index.html", "display": “standalone", "theme_color": "#77D48A", "background_color": "#E4B0AC" }
{ "short_name": “Application Name”, "name": “Application Full Name", "icons": [
{ "src": "launcher−icon−4x.png", "sizes": "192x192", "type": "image/png" } ], "start_url": "/index.html", "display": “standalone", "theme_color": "#77D48A", "background_color": "#E4B0AC" }
{ "short_name": “Application Name”, "name": “Application Full Name", "icons": [
{ "src": "launcher−icon−4x.png", "sizes": "192x192", "type": "image/png" } ], "start_url": “/index.html?app=true”, "display": “standalone", "theme_color": "#77D48A", "background_color": "#E4B0AC" }
{ "short_name": “Application Name”, "name": “Application Full Name", "icons": [
{ "src": "launcher−icon−4x.png", "sizes": "192x192", "type": "image/png" } ], "start_url": “/index.html?app=true”, "display": “standalone", "theme_color": "#77D48A", "background_color": "#E4B0AC" }
{ "short_name": “Application Name”, "name": “Application Full Name", "icons": [
{ "src": "launcher−icon−4x.png", "sizes": "192x192", "type": "image/png" } ], "start_url": “/index.html?app=true”, "display": “standalone", "theme_color": "#77D48A", "background_color": "#E4B0AC" }
None
None
None
None
• Have a registered worker service on your site. •
Have a manifest file with the basics configurations. • Be displayed by HTTPS. • Be visited at least twice, with at least five minutes between visits. Banner - Add to Home Screen
None
None
Fast Engaging Reliable *
Fast Engaging Reliable *
•Accessibility •Performance •HTML Semantic •Responsivity •Push Notifications
None
None
None
None
None
None
None
None
Progressive Web Apps are extensible!
None
None
None
/felipesousa
@felipz_sousa /felipesousa
@felipz_sousa /felipesousa felipesousa.me
thank’s! @felipz_sousa /felipesousa felipesousa.me