SlideShare a Scribd company logo
Everything you should know about
PWA to start (as a developer)
Filip Rakowski
Co-creator @ Vue Storefront
Frontend Developer @ Divante
Author @ PWA.buzz
filrakowski
frakowski
Subscribe!
PWA.buzz
What you’ll learn
01
02
03
What Progressive Web Apps are?
Short introduction to key features and ideas behind Progressive
Web Apps
Key technologies
We will take a look at technologies used in Progressive Web Apps
to achieve native-like and offline user experience.
PWA checklist
Hot to make your app a Progressive Web App.
4
What are PWAs?
5
Progressive web apps use modern web APIs along with traditional progressive
enhancement strategy to create cross-platform web applications. These apps work
everywhere and provide several features that give them the same user experience
advantages as native apps.
Mozilla MDN
More information: https://developers.google.com/web/progressive-web-apps/
What is Progressive Enhancement?
6
Progressive enhancement is a development approach, not a technology choice. You
as the developer, decide on a base level of user experience for your site or application, and
more advanced functionality is added if a browser supports it.
Shopify blog
More information: https://www.smashingmagazine.com/2009/04/progressive-enhancement-what-it-is-and-how-to-use-it/
Progressive Web apps are...
7
Reliable - Load instantly and never show the downasaur, even in uncertain network
conditions.
Progressive Web apps are...
8
Fast - Respond quickly to user interactions with silky smooth animations and no janky
scrolling.
Progressive Web apps are...
9
Engaging - Feel like a natural app on the device, with an immersive user experience.
Key technologies
Service Worker
Service Worker
12
Asynchronous JavaScript that runs in a browser (on a different thread in opposite to your
web apps single-threaded JavaScript) that can react to some events (like fetch, push) and
works even when website (or browser) are closed.
More information: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers
app.js
Service Worker - request proxy
13
Service Worker is a kind of proxy for you requests. You can modify them in your SW (e.g.
change the requested file name or serve it from cache instead of a server) before they are
proceeded to the server.
More information: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers
service-worker.js
Why using a Service Worker requires https?
Browser is not aware of modified requests!
Website
Please give me
index.html file
Please give me
notindex.html file
Service Worker Server
notindex.htmlnotindex.html but
the website is not
aware of it
Cache
16
In-browser database for storing JSON-like data. Best for caching dynamic data (JSON)
More information: https://developers.google.com/web/ilt/pwa/working-with-indexeddb
IndexedDB
IndexedDB
17
IndexedDB API is hard to work with but there are solutions that abstracts it to easier format:
Local Forage
iDB
...many others
Cache Storage
18
Object-request / Object-response browser database for caching network requests.
Best for caching static assets (HTML, CSS, JS)
More information: https://developer.mozilla.org/en-US/docs/Web/API/Cache
Caching resources
19
Static files:
- HTML
- CSS
- JS
- Fonts/Icons (bad idea)
Dynamic data
- JSONs from server
- Pending CUD operations
Cache Storage IndexedDB
Typical use case - serving app from cache when user is offline
20
Typical use case - serving app from cache when user is offline
21
Other use cases
22
- Serve static assets from cache for faster page
loads
- Use cache as a fallback for failed network
requests (or some of them)
Web App Manifest
What is Web App Manifest?
24
The web app manifest provides information about an application (such as name, author,
icon, and description) in a JSON text file. The purpose of the manifest is to install web
applications to the homescreen of a device, providing users with quicker access and a richer
experience.
Mozilla MDN
More information: https://developer.mozilla.org/en-US/docs/Web/Manifest
What is Web App Manifest?
25
What is Web App Manifest?
26
Native-like experience for Web Apps
27
Push API and notifications
Push notifications
29
Works exactly like native OS push notifications and uses Push API.
You can use them to engage your users (e.g. discounts) or send them important informations (like delayed flights).
Push notifications can be sent from Service Worker so they don’t need opened website to deliver messages
instantly.
More information: https://developers.google.com/web/ilt/pwa/introduction-to-push-notifications
How Push API works?
30
Background Sync
What is Background Sync
32
Background sync is a new web API that lets you defer actions until the user has stable
connectivity. This is useful for ensuring that whatever the user wants to send, is actually sent.
Google Developers
More information: https://developers.google.com/web/updates/2015/12/background-sync
What is Background Sync
33
Background sync allows you to provide real offline experience with all CRUD operations
available offline (Read with cache / Create, Update, Delete with Background sync).
You can also prefetch data periodically in the background so user don’t need to download it
when entering the website (see periodic sync)
For example: Like facebook/twitter post or place order on eCommerce shop while offline
Background Sync example
34
app.js
service-worker.js
PWA checklist
1. Cache your App Shell
36
Cache your App Shell (static assets) for instant loads and offline purposes. Use Cache Storage for this. Don’t forget to
make use of cached files in your Service Worker.
More information: https://developers.google.com/web/fundamentals/architecture/app-shell
2. Cache dynamic data from database
37
Cache dynamic data from server (mostly JSONs) and serve it from Cache Storage when
user is offline (or choose different caching strategy).
Use IndexedDB for this but keep in mind that it’s size is limited.
At this point your App should work offline, congrats!
3. Add Web App Manifest
38
Create Web App Manifest file (manifest.json) and allow users to pin your app to their
homescreens and use like a real Native App.
4. Use background sync for pending requests
39
Allow your users to perform Create, Update and Delete operations while offline with
Background Sync.
Congrats!
40
Your app is a fully-featured PWA now!
- Works like a native app (Web App Manifest)
- Is accessible from users homescreen (Web App Manifest)
- Loads insanely fast even on slow internet connection (Cache Storage, IndexedDB, Service Worker)
- Shows cached content while user is offline (Service Worker)
- Allows user to perform some actions without internet access) (Background Sync)
Possible additional enhancements
41
- Push Notifications
- Payment Request API
- Credentials API
Tools that can help you
42
Workbox
Workbox is a set of libraries and Node
modules that make it easy to cache
assets and take full advantage of
features used to build progressive web
app's.
See details
Google Lighthouse
Lighthouse is an open-source,
automated tool for improving the quality
of web pages. You can run it against
any web page, public or requiring
authentication. It has audits for
performance, accessibility, progressive
web apps, and more.
See details
More resources about PWA
43
- Google Developers
- Mozilla MDN
- ServiceWorker.rs (great cookbook!)
- PWA.buzz newsletter

More Related Content

What's hot

Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJS
M R Rony
 
What’s new in Visual Studio 2012 & .NET 4.5
What’s new in Visual Studio 2012 & .NET 4.5What’s new in Visual Studio 2012 & .NET 4.5
What’s new in Visual Studio 2012 & .NET 4.5
Robert MacLean
 
Single page application
Single page applicationSingle page application
Single page application
Arthur Fung
 
Wso2 product release webinar introducing jaggery
Wso2 product release webinar   introducing jaggeryWso2 product release webinar   introducing jaggery
Wso2 product release webinar introducing jaggeryWSO2
 
Shift Remote FRONTEND: Micro Frontend Architecture: A Look Into the Future - ...
Shift Remote FRONTEND: Micro Frontend Architecture: A Look Into the Future - ...Shift Remote FRONTEND: Micro Frontend Architecture: A Look Into the Future - ...
Shift Remote FRONTEND: Micro Frontend Architecture: A Look Into the Future - ...
Shift Conference
 
Windows Store Apps: Tips & Tricks
Windows Store Apps: Tips & TricksWindows Store Apps: Tips & Tricks
Windows Store Apps: Tips & TricksRobert MacLean
 
Web Application Development Process presented by @Cygnismedia
Web Application Development Process presented by @CygnismediaWeb Application Development Process presented by @Cygnismedia
Web Application Development Process presented by @Cygnismedia
Clark Davidson
 
Single Page Applications
Single Page ApplicationsSingle Page Applications
Single Page Applications
Massimo Iacolare
 
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
DevDay.org
 
Aeternity Blockchain - Ecosystem & Devtools [2019]
Aeternity Blockchain - Ecosystem & Devtools [2019]Aeternity Blockchain - Ecosystem & Devtools [2019]
Aeternity Blockchain - Ecosystem & Devtools [2019]
Przemysław Thomann
 
Progressive Web App (feat. React, Django)
Progressive Web App (feat. React, Django)Progressive Web App (feat. React, Django)
Progressive Web App (feat. React, Django)
Yurim Jin
 
A Gentle Introduction to Blazor
A Gentle Introduction to BlazorA Gentle Introduction to Blazor
A Gentle Introduction to Blazor
Jose Javier Columbie
 
Windows 8
Windows 8Windows 8
Windows 8
Robert MacLean
 
Vue3: nuove funzionalità, differenze e come migrare
Vue3: nuove funzionalità, differenze e come migrareVue3: nuove funzionalità, differenze e come migrare
Vue3: nuove funzionalità, differenze e come migrare
Andrea Campaci
 
ngStockholm #8 at NetEnt - Micro Frontend Architecture
ngStockholm #8 at NetEnt - Micro Frontend ArchitecturengStockholm #8 at NetEnt - Micro Frontend Architecture
ngStockholm #8 at NetEnt - Micro Frontend Architecture
Ishaan Puniani
 
WebMatrix
WebMatrixWebMatrix
WebMatrix
Robert MacLean
 
Micro Frontends Architecture - Jitendra kumawat (Guavus)
Micro Frontends Architecture - Jitendra kumawat (Guavus)Micro Frontends Architecture - Jitendra kumawat (Guavus)
Micro Frontends Architecture - Jitendra kumawat (Guavus)
Tech Triveni
 
WordPress development checklist
WordPress development checklistWordPress development checklist
WordPress development checklist
Binh Quan Duc
 
Full stack web development
Full stack web developmentFull stack web development
Full stack web development
Crampete
 

What's hot (19)

Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJS
 
What’s new in Visual Studio 2012 & .NET 4.5
What’s new in Visual Studio 2012 & .NET 4.5What’s new in Visual Studio 2012 & .NET 4.5
What’s new in Visual Studio 2012 & .NET 4.5
 
Single page application
Single page applicationSingle page application
Single page application
 
Wso2 product release webinar introducing jaggery
Wso2 product release webinar   introducing jaggeryWso2 product release webinar   introducing jaggery
Wso2 product release webinar introducing jaggery
 
Shift Remote FRONTEND: Micro Frontend Architecture: A Look Into the Future - ...
Shift Remote FRONTEND: Micro Frontend Architecture: A Look Into the Future - ...Shift Remote FRONTEND: Micro Frontend Architecture: A Look Into the Future - ...
Shift Remote FRONTEND: Micro Frontend Architecture: A Look Into the Future - ...
 
Windows Store Apps: Tips & Tricks
Windows Store Apps: Tips & TricksWindows Store Apps: Tips & Tricks
Windows Store Apps: Tips & Tricks
 
Web Application Development Process presented by @Cygnismedia
Web Application Development Process presented by @CygnismediaWeb Application Development Process presented by @Cygnismedia
Web Application Development Process presented by @Cygnismedia
 
Single Page Applications
Single Page ApplicationsSingle Page Applications
Single Page Applications
 
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
[DevDay2019] Micro Frontends Architecture - By Thang Pham, Senior Software En...
 
Aeternity Blockchain - Ecosystem & Devtools [2019]
Aeternity Blockchain - Ecosystem & Devtools [2019]Aeternity Blockchain - Ecosystem & Devtools [2019]
Aeternity Blockchain - Ecosystem & Devtools [2019]
 
Progressive Web App (feat. React, Django)
Progressive Web App (feat. React, Django)Progressive Web App (feat. React, Django)
Progressive Web App (feat. React, Django)
 
A Gentle Introduction to Blazor
A Gentle Introduction to BlazorA Gentle Introduction to Blazor
A Gentle Introduction to Blazor
 
Windows 8
Windows 8Windows 8
Windows 8
 
Vue3: nuove funzionalità, differenze e come migrare
Vue3: nuove funzionalità, differenze e come migrareVue3: nuove funzionalità, differenze e come migrare
Vue3: nuove funzionalità, differenze e come migrare
 
ngStockholm #8 at NetEnt - Micro Frontend Architecture
ngStockholm #8 at NetEnt - Micro Frontend ArchitecturengStockholm #8 at NetEnt - Micro Frontend Architecture
ngStockholm #8 at NetEnt - Micro Frontend Architecture
 
WebMatrix
WebMatrixWebMatrix
WebMatrix
 
Micro Frontends Architecture - Jitendra kumawat (Guavus)
Micro Frontends Architecture - Jitendra kumawat (Guavus)Micro Frontends Architecture - Jitendra kumawat (Guavus)
Micro Frontends Architecture - Jitendra kumawat (Guavus)
 
WordPress development checklist
WordPress development checklistWordPress development checklist
WordPress development checklist
 
Full stack web development
Full stack web developmentFull stack web development
Full stack web development
 

Similar to PWA basics for developers

Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
Software Infrastructure
 
Progressive web app
Progressive web appProgressive web app
Progressive web app
Deepak Upadhyay
 
Checklist for progressive web app development
Checklist for progressive web app developmentChecklist for progressive web app development
Checklist for progressive web app development
WebGuru Infosystems Pvt. Ltd.
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
Saikiran Sheshagiri
 
Food borne human diseases
Food borne human diseasesFood borne human diseases
Food borne human diseases
AmalMohammedNasserSa
 
Progressive web app testing
Progressive web app testingProgressive web app testing
Progressive web app testing
Kalhan Liyanage
 
Why Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandWhy Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp Finland
Imran Sayed
 
Progressive Web Applications - The Next Gen Web Technologies
Progressive Web Applications - The Next Gen Web TechnologiesProgressive Web Applications - The Next Gen Web Technologies
Progressive Web Applications - The Next Gen Web Technologies
GeekNightHyderabad
 
Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020
Imran Sayed
 
Introduction of Progressive Web App
Introduction of Progressive Web AppIntroduction of Progressive Web App
Introduction of Progressive Web App
Sankalp Khandelwal
 
A Quick Guide On Mobile App Backend Development For Busy People.docx
A Quick Guide On Mobile App Backend Development For Busy People.docxA Quick Guide On Mobile App Backend Development For Busy People.docx
A Quick Guide On Mobile App Backend Development For Busy People.docx
goodcoders
 
A Quick Guide On Mobile App Backend Development For Busy People.docx
A Quick Guide On Mobile App Backend Development For Busy People.docxA Quick Guide On Mobile App Backend Development For Busy People.docx
A Quick Guide On Mobile App Backend Development For Busy People.docx
goodcoders
 
Exploring pwa for shopware
Exploring pwa for shopwareExploring pwa for shopware
Exploring pwa for shopware
Sander Mangel
 
Website and it's importance
Website and it's importanceWebsite and it's importance
Website and it's importance
RobinSingh347
 
SharePoint 2013 App Provisioning Models
SharePoint 2013 App Provisioning ModelsSharePoint 2013 App Provisioning Models
SharePoint 2013 App Provisioning Models
Shailen Sukul
 
Progressive web application
Progressive web applicationProgressive web application
Progressive web application
RavikantGautam8
 
Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps / GDG DevFest - Season 2016Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps / GDG DevFest - Season 2016
Abdelrahman Omran
 
A Complete Guide To Progressive Web App.pdf
A Complete Guide To Progressive Web App.pdfA Complete Guide To Progressive Web App.pdf
A Complete Guide To Progressive Web App.pdf
Cerebrum Infotech
 
Progressive Web App
Progressive Web AppProgressive Web App
Progressive Web App
SaleemMalik52
 
Jws masterclass progressive web apps
Jws masterclass progressive web appsJws masterclass progressive web apps
Jws masterclass progressive web apps
Alexandre Marreiros
 

Similar to PWA basics for developers (20)

Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Progressive web app
Progressive web appProgressive web app
Progressive web app
 
Checklist for progressive web app development
Checklist for progressive web app developmentChecklist for progressive web app development
Checklist for progressive web app development
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Food borne human diseases
Food borne human diseasesFood borne human diseases
Food borne human diseases
 
Progressive web app testing
Progressive web app testingProgressive web app testing
Progressive web app testing
 
Why Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp FinlandWhy Progressive Web Apps For WordPress - WordCamp Finland
Why Progressive Web Apps For WordPress - WordCamp Finland
 
Progressive Web Applications - The Next Gen Web Technologies
Progressive Web Applications - The Next Gen Web TechnologiesProgressive Web Applications - The Next Gen Web Technologies
Progressive Web Applications - The Next Gen Web Technologies
 
Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020Why progressive apps for WordPress - WordSesh 2020
Why progressive apps for WordPress - WordSesh 2020
 
Introduction of Progressive Web App
Introduction of Progressive Web AppIntroduction of Progressive Web App
Introduction of Progressive Web App
 
A Quick Guide On Mobile App Backend Development For Busy People.docx
A Quick Guide On Mobile App Backend Development For Busy People.docxA Quick Guide On Mobile App Backend Development For Busy People.docx
A Quick Guide On Mobile App Backend Development For Busy People.docx
 
A Quick Guide On Mobile App Backend Development For Busy People.docx
A Quick Guide On Mobile App Backend Development For Busy People.docxA Quick Guide On Mobile App Backend Development For Busy People.docx
A Quick Guide On Mobile App Backend Development For Busy People.docx
 
Exploring pwa for shopware
Exploring pwa for shopwareExploring pwa for shopware
Exploring pwa for shopware
 
Website and it's importance
Website and it's importanceWebsite and it's importance
Website and it's importance
 
SharePoint 2013 App Provisioning Models
SharePoint 2013 App Provisioning ModelsSharePoint 2013 App Provisioning Models
SharePoint 2013 App Provisioning Models
 
Progressive web application
Progressive web applicationProgressive web application
Progressive web application
 
Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps / GDG DevFest - Season 2016Progressive Web Apps / GDG DevFest - Season 2016
Progressive Web Apps / GDG DevFest - Season 2016
 
A Complete Guide To Progressive Web App.pdf
A Complete Guide To Progressive Web App.pdfA Complete Guide To Progressive Web App.pdf
A Complete Guide To Progressive Web App.pdf
 
Progressive Web App
Progressive Web AppProgressive Web App
Progressive Web App
 
Jws masterclass progressive web apps
Jws masterclass progressive web appsJws masterclass progressive web apps
Jws masterclass progressive web apps
 

Recently uploaded

JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
Javier Lasa
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
GTProductions1
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
natyesu
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
VivekSinghShekhawat2
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 

Recently uploaded (20)

JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 

PWA basics for developers

  • 1. Everything you should know about PWA to start (as a developer)
  • 2. Filip Rakowski Co-creator @ Vue Storefront Frontend Developer @ Divante Author @ PWA.buzz filrakowski frakowski
  • 4. What you’ll learn 01 02 03 What Progressive Web Apps are? Short introduction to key features and ideas behind Progressive Web Apps Key technologies We will take a look at technologies used in Progressive Web Apps to achieve native-like and offline user experience. PWA checklist Hot to make your app a Progressive Web App. 4
  • 5. What are PWAs? 5 Progressive web apps use modern web APIs along with traditional progressive enhancement strategy to create cross-platform web applications. These apps work everywhere and provide several features that give them the same user experience advantages as native apps. Mozilla MDN More information: https://developers.google.com/web/progressive-web-apps/
  • 6. What is Progressive Enhancement? 6 Progressive enhancement is a development approach, not a technology choice. You as the developer, decide on a base level of user experience for your site or application, and more advanced functionality is added if a browser supports it. Shopify blog More information: https://www.smashingmagazine.com/2009/04/progressive-enhancement-what-it-is-and-how-to-use-it/
  • 7. Progressive Web apps are... 7 Reliable - Load instantly and never show the downasaur, even in uncertain network conditions.
  • 8. Progressive Web apps are... 8 Fast - Respond quickly to user interactions with silky smooth animations and no janky scrolling.
  • 9. Progressive Web apps are... 9 Engaging - Feel like a natural app on the device, with an immersive user experience.
  • 12. Service Worker 12 Asynchronous JavaScript that runs in a browser (on a different thread in opposite to your web apps single-threaded JavaScript) that can react to some events (like fetch, push) and works even when website (or browser) are closed. More information: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers app.js
  • 13. Service Worker - request proxy 13 Service Worker is a kind of proxy for you requests. You can modify them in your SW (e.g. change the requested file name or serve it from cache instead of a server) before they are proceeded to the server. More information: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers service-worker.js
  • 14. Why using a Service Worker requires https? Browser is not aware of modified requests! Website Please give me index.html file Please give me notindex.html file Service Worker Server notindex.htmlnotindex.html but the website is not aware of it
  • 15. Cache
  • 16. 16 In-browser database for storing JSON-like data. Best for caching dynamic data (JSON) More information: https://developers.google.com/web/ilt/pwa/working-with-indexeddb IndexedDB
  • 17. IndexedDB 17 IndexedDB API is hard to work with but there are solutions that abstracts it to easier format: Local Forage iDB ...many others
  • 18. Cache Storage 18 Object-request / Object-response browser database for caching network requests. Best for caching static assets (HTML, CSS, JS) More information: https://developer.mozilla.org/en-US/docs/Web/API/Cache
  • 19. Caching resources 19 Static files: - HTML - CSS - JS - Fonts/Icons (bad idea) Dynamic data - JSONs from server - Pending CUD operations Cache Storage IndexedDB
  • 20. Typical use case - serving app from cache when user is offline 20
  • 21. Typical use case - serving app from cache when user is offline 21
  • 22. Other use cases 22 - Serve static assets from cache for faster page loads - Use cache as a fallback for failed network requests (or some of them)
  • 24. What is Web App Manifest? 24 The web app manifest provides information about an application (such as name, author, icon, and description) in a JSON text file. The purpose of the manifest is to install web applications to the homescreen of a device, providing users with quicker access and a richer experience. Mozilla MDN More information: https://developer.mozilla.org/en-US/docs/Web/Manifest
  • 25. What is Web App Manifest? 25
  • 26. What is Web App Manifest? 26
  • 28. Push API and notifications
  • 29. Push notifications 29 Works exactly like native OS push notifications and uses Push API. You can use them to engage your users (e.g. discounts) or send them important informations (like delayed flights). Push notifications can be sent from Service Worker so they don’t need opened website to deliver messages instantly. More information: https://developers.google.com/web/ilt/pwa/introduction-to-push-notifications
  • 30. How Push API works? 30
  • 32. What is Background Sync 32 Background sync is a new web API that lets you defer actions until the user has stable connectivity. This is useful for ensuring that whatever the user wants to send, is actually sent. Google Developers More information: https://developers.google.com/web/updates/2015/12/background-sync
  • 33. What is Background Sync 33 Background sync allows you to provide real offline experience with all CRUD operations available offline (Read with cache / Create, Update, Delete with Background sync). You can also prefetch data periodically in the background so user don’t need to download it when entering the website (see periodic sync) For example: Like facebook/twitter post or place order on eCommerce shop while offline
  • 36. 1. Cache your App Shell 36 Cache your App Shell (static assets) for instant loads and offline purposes. Use Cache Storage for this. Don’t forget to make use of cached files in your Service Worker. More information: https://developers.google.com/web/fundamentals/architecture/app-shell
  • 37. 2. Cache dynamic data from database 37 Cache dynamic data from server (mostly JSONs) and serve it from Cache Storage when user is offline (or choose different caching strategy). Use IndexedDB for this but keep in mind that it’s size is limited. At this point your App should work offline, congrats!
  • 38. 3. Add Web App Manifest 38 Create Web App Manifest file (manifest.json) and allow users to pin your app to their homescreens and use like a real Native App.
  • 39. 4. Use background sync for pending requests 39 Allow your users to perform Create, Update and Delete operations while offline with Background Sync.
  • 40. Congrats! 40 Your app is a fully-featured PWA now! - Works like a native app (Web App Manifest) - Is accessible from users homescreen (Web App Manifest) - Loads insanely fast even on slow internet connection (Cache Storage, IndexedDB, Service Worker) - Shows cached content while user is offline (Service Worker) - Allows user to perform some actions without internet access) (Background Sync)
  • 41. Possible additional enhancements 41 - Push Notifications - Payment Request API - Credentials API
  • 42. Tools that can help you 42 Workbox Workbox is a set of libraries and Node modules that make it easy to cache assets and take full advantage of features used to build progressive web app's. See details Google Lighthouse Lighthouse is an open-source, automated tool for improving the quality of web pages. You can run it against any web page, public or requiring authentication. It has audits for performance, accessibility, progressive web apps, and more. See details
  • 43. More resources about PWA 43 - Google Developers - Mozilla MDN - ServiceWorker.rs (great cookbook!) - PWA.buzz newsletter