“We’ve launched 30+ features to make the web more capable”
Developers: “New features you say?”
Slide 83
Developers: Doesn’t implement new features
Slide 84
h
Slide 85
Slide 86
❌ Platform parity ❌ Usage of features
Slide 87
How capable are PWAs today?
🙂
✅ Close to feature parity with native applications ❌ Platform parity ❌ Usage of features
Slide 88
How reliable are PWAs today?
Slide 89
h
Slide 90
Slide 91
Slide 92
Slide 93
Slide 94
Slide 95
Cache JS & CSS import {StaleWhileRevalidate} from ‘workbox-strategies’;
registerRoute( ({request})
request.destination
‘script’ || request.destination
new StaleWhileRevalidate()
=
=
=
=
);
‘style’,
Slide 96
Offline Google Analytics
import * as googleAnalytics from ‘workbox-google-analytics’; googleAnalytics.initialize();
Slide 97
Service Offline Page const networkOnly = new NetworkOnly(); registerRoute( new NavigationRoute(async (params)
{
try { return await networkOnly.handle(params); } catch (error) { return caches.match(FALLBACK_HTML_URL, { cacheName: CACHE_NAME }); }
=
}) );
Slide 98
🤩
Slide 99
h
Slide 100
Slide 101
Slide 102
Slide 103
Slide 104
Slide 105
Slide 106
Slide 107
Slide 108
Local Storage & Session Storage Cache Storage
Slide 109
SESSION
Slide 110
PWAs today are fast
Slide 111
Image from h
Slide 112
instant, reliably good performance to users on repeat visits. This means the application shell is not loaded from the network every time the user visits. Only the necessary content is needed from the network.
h
Slide 113
Slide 114
65% increase in pages per session 75% increase in Tweets sent 20% decrease in bounce rate
h
Slide 115
The web app rivals the performance of our native apps but requires less than 3% of the device storage space compared to Twitter for Android.
h
Slide 116
Slide 117
Slide 118
Slide 119
Slide 120
Slide 121
Slide 122
Slide 123
Slide 124
✅ PWAs are faster, more resilient, and more accessible
Slide 125
How reliable are PWAs today?
😁
✅ Service worker, and it’s tooling, are well supported ✅ PWAs are faster, more resilient, and more accessible
Slide 126
How installable are PWAs today?
Slide 127
Slide 128
Slide 129
Requirements for “Add to Home Screen”
Slide 130
Requirements for “Add to Home Screen” 1. Web app manifest
Slide 131
Requirements for “Add to Home Screen” 1. Web app manifest 2. HTTPS
Slide 132
Requirements for “Add to Home Screen” 1. Web app manifest 2. HTTPS 3. Service worker (which returns a 200 response when offline)
Slide 133
Requirements for “Add to Home Screen” 1. Web app manifest 2. HTTPS 3. Service worker (which returns a 200 response when offline) 4. User engagement heuristic
Slide 134
More control over the install flow
Slide 135
Detect if a PWA can be installed
window.addEventListener(‘beforeinstallprompt’, (e)
=
});
{
Slide 136
Save install prompt for later let installPrompt; window.addEventListener(‘beforeinstallprompt’, (e) e.preventDefault(); installPrompt = e;
=
});
{
Slide 137
Detect if a PWA has been installed
window.addEventListener(‘appinstalled’, (e)
Run on OS Login
navigator.runOnOsLogin.set({ mode: “windowed” }).then(() // Permission approved
=
});
{
Slide 147
SESSION
Slide 148
Add to Homescreen == Install
Slide 149
Slide 150
A WebAPK is an Android Application Package (APK) automatically generated from a PWA and installed to the device.
Slide 151
Benefits of WebAPK
Slide 152
Benefits of WebAPK ✅ In the app drawer
Slide 153
Benefits of WebAPK ✅ In the app drawer ✅ In app settings
Slide 154
Benefits of WebAPK ✅ In the app drawer ✅ In app settings ✅ Includes intent filters
Slide 155
Native Apps
PWAs on App Stores
Slide 156
h
Slide 157
Slide 158
Slide 159
Slide 160
is a way to open your PWA from your Android app using a protocol based on Custom Tabs
h
Slide 161
Slide 162
Slide 163
Slide 164
Slide 165
Slide 166
Slide 167
Slide 168
Slide 169
Slide 170
✅ More control over the install experience ✅ Deeper integration with the device ❌ Platform parity
Slide 171
How installable are PWAs today?
😁
✅ “Add to Homescreen” is well supported
✅ More control over the install experience ✅ Deeper integration with the device ❌ Platform parity
Slide 172
PWAs Tomorrow
Slide 173
🤩 Capable 🤩 Reliable 🤩 Installable
Slide 174
All the APIs!
Slide 175
File Handling API (Origin Trial)
h
Slide 176
(Developer Trial)
h
Slide 177
(Under Consideration)
h
Slide 178
Detecting orientation change events Widgets Detect/block screenshots Splash screen API Local font access
Slide 179
Almost 20% of page loads are controlled by Service Workers
h
Slide 180
Slide 181
Slide 182
Slide 183
Slide 184
COO & VP Engineering of Buycoins Google Web Expert ireaderinokun.com bitsofco.de @ireaderinokun