This document is a presentation on progressive web apps (PWAs) given by Filip Rakowski. It discusses key aspects of PWAs including service workers, caching strategies, payment APIs, push notifications, background synchronization, web workers, and web app manifests. The presentation emphasizes how these technologies allow PWAs to provide native app-like experiences through features like offline support, push notifications, and one-click installation.
6. #MM18PL#MM18PL
„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 Developer Network
@filrakowski
12. #MM18PL#MM18PL
Service Workers are Web Workers that can
intercept navigation and resource requests.
They also work on a separate thread so they
are not terminated with your Web App!
Service Worker
@filrakowski
22. #MM18PL#MM18PL
Service Worker
@filrakowski
Your Web App
https://name.com
Server with API
https://name.com/api
GET /users
error
server is down, lack of
internet connection etc
Service
Worker/users
Oops! I can’t fetch /users.
Let’s serve it from cache!
Cache
23. #MM18PL#MM18PL
Service Worker
@filrakowski
Your Web App
https://name.com
Server with API
https://name.com/api
GET /users
error
server is down, lack of
internet connection etc
Service
Worker/users
Do i have response
for /users cached?
Cache
24. #MM18PL#MM18PL
Service Worker
@filrakowski
Your Web App
https://name.com
Server with API
https://name.com/api
GET /users
error
server is down, lack of
internet connection etc
Service
Worker/users
Cache
/users
/users
29. #MM18PL#MM18PL
There is much more about handling Cache
Google.com: ‘Google Offline Cookbook’
@filrakowski
or type https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/
30. #MM18PL#MM18PL
Service Worker
@filrakowski
Depending on type of a request and handled
circumstances Service Worker decides where to look for a
particular resource:
- Images/fonts always from cache
- JSON data from network
and from cache while offline
- ...
36. #MM18PL#MM18PL
@filrakowski
Payment Request API
- One-click checkout without
needing to register or
provide order details
- Credit cards and Shipping
details shared between all
websites making use of
Payment Request API
40. #MM18PL#MM18PL
@filrakowski
Notifications API – an interface used to configure and
display notifications to the user
Push API – an interface used to subscribe your app to a
push service and receive push messages in the service
worker
41. #MM18PL#MM18PL
@filrakowski
Notification & Web Push API
- Ask for subscription (if
user declines you can’t do it
again!!)
- Display notifications from
Service Worker working on
background
Inside Service Worker
58. #MM18PL#MM18PL
@filrakowski
Web App Manifest
- Add to homescreen like a
native app*
- Display without
browser’s UI so user can’t
see the difference
*from latest chrome version Homescreen
installation banner is not displaying
automatically. You need to run `prompt()`
method on prompt object.
59. #MM18PL#MM18PL
Workerize - delegate js modules to Web Workers
https://github.com/developit/workerize
ServiceWorkerWare - Express-like request middleware in Service Worker
https://github.com/fxos-components/serviceworkerware
Other awesome PWA stuff https://github.com/hemanth/awesome-pwa
@filrakowski
60. #MM18PL#MM18PL
You can follow me on twitter where I addictively
tweet about PWA @filrakowski (slides will be
there too)
Thank you!
Editor's Notes
I’m gonna talk about something that probably most of you is tired of - Progressive Web Apps. Before I continue I just want to ask two questions.
While in eCommerce industry PWA is obviously a big buzzword representing the modern JS approach to building eCommerce stores the PWA technology itself in my opinion deserves this buzz like nothing else. During this talk I’ll try to show you just a small piece of the stuff you can achieve with PWA technology and trust me - it’s not just about replacing the native apps
First I need to be sure that by saying ‘Progressive Web Apps’ we all mean the same so here is a great definition from Mozilla Dev Network
As the definition may sound complicated in fact it’s very easy and intuitive. Let’s focus on highlited parts. PWA are using modern web api with progressive wnhancement strategy - it means that we are providing a bseline of our apps functionality to everyone no matter what browser they are using and progressively enhancing this functionality with what modern JS APIs can offer. But remember - you can’t rely on a modern APIs always need a fallback.
As the definition may sound complicated in fact it’s very easy and intuitive. Let’s focus on highlited parts. PWA are using modern web api with progressive wnhancement strategy - it means that we are providing a bseline of our apps functionality to everyone no matter what browser they are using and progressively enhancing this functionality with what modern JS APIs can offer. But remember - you can’t rely on a modern APIs always need a fallback.