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
740
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
410
Shared web-components with StencilJS
felipesousa
0
650
Criando aplicações componentizadas com Polymer
felipesousa
0
400
Criando aplicações componentizadas com Polymer - C4P CEJS 2017
felipesousa
1
280
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
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
2.8k
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
1
270
php-fpmのプロセスが枯渇した日-調査・対処・そして本当にやるべきだったこと-
shibuchaaaan
0
210
その節約、円になってますか?
isamumumu
1
670
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
650
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
750
テーブルをDELETEした
yuzneri
0
130
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
140
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
200
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
390
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
150
Google Apps Script で Ruby を動かす
kawahara
0
130
Featured
See All Featured
How to Ace a Technical Interview
jacobian
281
24k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.5k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.1k
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Agile that works and the tools we love
rasmusluckow
331
22k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
320
Being A Developer After 40
akosma
91
590k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
480
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
119
120k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Everyday Curiosity
cassininazir
0
270
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