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 DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
210
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
130
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
200
Claude Code全社展開のためにやったことn選~プラグイン302個・コミッター271人を支えるために~
kenchan
2
1.1k
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
250
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
200
その節約、円になってますか?
isamumumu
1
670
What's New in Android 2026
veronikapj
0
250
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
360
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
740
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
440
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
1.1k
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
The SEO identity crisis: Don't let AI make you average
varn
0
520
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.9k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Code Reviewing Like a Champion
maltzj
528
40k
KATA
mclloyd
PRO
35
15k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Docker and Python
trallard
47
4.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Exploring anti-patterns in Rails
aemeredith
3
450
Java REST API Framework Comparison - PWX 2021
mraible
34
9.6k
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