The Hitchhikers Guide to PWAs

A presentation at Squiz Summit 2018 in October 2018 in London, UK by Dave Letorey

Slide 1

Slide 1

THE HITCHHIKERS GUIDE TO PROGRESSIVE WEB APPS Dave Letorey Matrix Evangelist

Slide 2

Slide 2

Web Apps or Native Apps

Slide 3

Slide 3

Web Apps or Native Apps

Slide 4

Slide 4

Web Apps or Native Apps

Slide 5

Slide 5

Web Apps or Native Apps

Slide 6

Slide 6

Slide 7

Slide 7

By DAVE LETOREY

Slide 8

Slide 8

Contents

Slide 9

Slide 9

Contents • The Web continues to win

Slide 10

Slide 10

Contents • The Web continues to win • What are PWAs

Slide 11

Slide 11

Contents • The Web continues to win • What are PWAs • Why PWAs

Slide 12

Slide 12

Contents • The Web continues to win • What are PWAs • Why PWAs • PWAs the Technology

Slide 13

Slide 13

Contents • The Web continues to win • What are PWAs • Why PWAs • PWAs the Technology • Still to come

Slide 14

Slide 14

Contents • The Web continues to win • What are PWAs • Why PWAs • PWAs the Technology • Still to come • PWA Examples

Slide 15

Slide 15

Check out the Summit App

Slide 16

Slide 16

Check out the Summit App http://example.com

Slide 17

Slide 17

The Web continues to win

Slide 18

Slide 18

The World Wide Web (www)

Slide 19

Slide 19

The World Wide Web (www) http://info.cern.ch/Proposal.html

Slide 20

Slide 20

The World Wide Web (www) http://info.cern.ch/Proposal.html

Slide 21

Slide 21

The First Website

Slide 22

Slide 22

The First Website http://info.cern.ch/hypertext/WWW/TheProject.html

Slide 23

Slide 23

The First MultiOS Browser

Slide 24

Slide 24

The First MultiOS Browser https://twitter.com/jensimmons/status/1046752366018613248

Slide 25

Slide 25

CD ROMS (MS Encarta)

Slide 26

Slide 26

CD ROMS (MS Encarta)

Slide 27

Slide 27

CSS & JavaScript

Slide 28

Slide 28

CSS & JavaScript

Slide 29

Slide 29

Flash Sites

Slide 30

Slide 30

Flash Sites

Slide 31

Slide 31

Flash Sites

Slide 32

Slide 32

Flash Sites https://www.youtube.com/watch?v=9Y-ESJS911c

Slide 33

Slide 33

HTML 5.0

Slide 34

Slide 34

HTML 5.0

Slide 35

Slide 35

Apple iPhone

Slide 36

Slide 36

Apple iPhone https://www.youtube.com/watch?v=MnrJzXM7a6o

Slide 37

Slide 37

Apple iPhone https://www.youtube.com/watch?v=MnrJzXM7a6o

Slide 38

Slide 38

Apple iPhone https://www.youtube.com/watch?v=MnrJzXM7a6o

Slide 39

Slide 39

Responsive Web Design

Slide 40

Slide 40

Responsive Web Design http://ami.responsivedesign.is/?url=https%3A%2F%2Falistapart.com%2Farticle%2Fresponsive-web-design

Slide 41

Slide 41

Progressive Web Apps

Slide 42

Slide 42

Progressive Web Apps

Slide 43

Slide 43

What are PWAs Progressive Web Apps

Slide 44

Slide 44

Progressive Web App

Slide 45

Slide 45

Progressive Web App

Slide 46

Slide 46

Progressive Web App

Slide 47

Slide 47

Progressive Web App

Slide 48

Slide 48

Progressive Web App

Slide 49

Slide 49

Progressive Web App

Slide 50

Slide 50

Progressive Web App

Slide 51

Slide 51

Progressive Web App

Slide 52

Slide 52

Progressive Web App

Slide 53

Slide 53

Progressive Web App

Slide 54

Slide 54

Progressive Web App https://fberriman.com/2017/06/26/naming-progressive-web-apps/

Slide 55

Slide 55

Progressive Web App https://fberriman.com/2017/06/26/naming-progressive-web-apps/

Slide 56

Slide 56

Progressive Web App

Slide 57

Slide 57

Responsive

Slide 58

Slide 58

Responsive

Slide 59

Slide 59

Connectivity Independent

Slide 60

Slide 60

Connectivity Independent

Slide 61

Slide 61

App-Like aka App-y

Slide 62

Slide 62

App-Like aka App-y

Slide 63

Slide 63

Fresh

Slide 64

Slide 64

Fresh

Slide 65

Slide 65

Safe

Slide 66

Slide 66

Safe

Slide 67

Slide 67

Why PWAs

Slide 68

Slide 68

WWW is the Biggest Platform

Slide 69

Slide 69

WWW is the Biggest Platform https://www.slideshare.net/TheBlackFin/google-io-2017-full-recap

Slide 70

Slide 70

Not everyone has…

Slide 71

Slide 71

Not everyone has…

Slide 72

Slide 72

Data is a critical

Slide 73

Slide 73

Data is a critical https://medium.com/@anicollected/conquering-africa-the-story-of-transsion-maker-of-tecno-infinix-and-itel-phones-ea163008ee84

Slide 74

Slide 74

Memories are important

Slide 75

Slide 75

Memories are important

Slide 76

Slide 76

Memories are important

Slide 77

Slide 77

Every Step costs you 20%

Slide 78

Slide 78

Every Step costs you 20% https://medium.com/gabor/every-step-costs-you-20-of-users-b613a804c329

Slide 79

Slide 79

Almost no one uses an app

Slide 80

Slide 80

Almost no one uses an app http://appleinsider.com/articles/09/02/19/iphone_app_usage_declining_rapidly_after_first_downloads

Slide 81

Slide 81

Analytics

Slide 82

Slide 82

Analytics

Slide 83

Slide 83

Features Native v PWA

Slide 84

Slide 84

Features Native v PWA

Slide 85

Slide 85

Features Native v PWA

Slide 86

Slide 86

Features Native v PWA

Slide 87

Slide 87

Features Native v PWA

Slide 88

Slide 88

Features Native v PWA

Slide 89

Slide 89

Features Native v PWA

Slide 90

Slide 90

Features Native v PWA

Slide 91

Slide 91

Features Native v PWA

Slide 92

Slide 92

Features Native v PWA

Slide 93

Slide 93

Features Native v PWA

Slide 94

Slide 94

Features Native v PWA

Slide 95

Slide 95

Features Native v PWA

Slide 96

Slide 96

Features Native v PWA

Slide 97

Slide 97

Features Native v PWA

Slide 98

Slide 98

Features Native v PWA

Slide 99

Slide 99

Features Native v PWA

Slide 100

Slide 100

Features Native v PWA

Slide 101

Slide 101

Features Native v PWA

Slide 102

Slide 102

Features Native v PWA

Slide 103

Slide 103

PWAs the Technology

Slide 104

Slide 104

The Basics

Slide 105

Slide 105

The Basics https://matrix.squiz.co.uk/h2g2/index.html

Slide 106

Slide 106

The Basics

Slide 107

Slide 107

The Basics https://matrix.squiz.co.uk/h2g2/index.html

Slide 108

Slide 108

SVG

Slide 109

Slide 109

SVG https://caniuse.com/#feat=svg

Slide 110

Slide 110

SVG

Slide 111

Slide 111

SVG https://caniuse.com/#feat=svg

Slide 112

Slide 112

CSS

Slide 113

Slide 113

CSS https://caniuse.com/#search=css%20animation

Slide 114

Slide 114

CSS https://caniuse.com/#search=css%20animation

Slide 115

Slide 115

CSS https://caniuse.com/#search=css%20animation

Slide 116

Slide 116

Progressive Web Apps

Slide 117

Slide 117

Progressive Web Apps

Slide 118

Slide 118

Service Workers

Slide 119

Slide 119

Service Workers

Slide 120

Slide 120

Service Workers

Slide 121

Slide 121

Service Workers

Slide 122

Slide 122

Service Workers

Slide 123

Slide 123

Service Workers

Slide 124

Slide 124

Service Workers

Slide 125

Slide 125

Service Workers

Slide 126

Slide 126

Service Workers

Slide 127

Slide 127

Service Workers

Slide 128

Slide 128

Service Workers

Slide 129

Slide 129

Service Workers

Slide 130

Slide 130

Service Workers

Slide 131

Slide 131

Service Workers

Slide 132

Slide 132

Service Workers

Slide 133

Slide 133

Service Workers Return requests from Cache

Slide 134

Slide 134

Service Workers Return requests from Cache Fetch requests from the Network

Slide 135

Slide 135

Service Workers Return requests from Cache Fetch requests from the Network Cache requests for the future

Slide 136

Slide 136

Service Workers Return requests from Cache Fetch requests from the Network Cache requests for the future Check to see if there’s a connection

Slide 137

Slide 137

Service Workers Return requests from Cache Fetch requests from the Network Cache requests for the future Check to see if there’s a connection Set up promises if something is not ready

Slide 138

Slide 138

Service Worker Scope

Slide 139

Slide 139

Service Worker Scope https://example.com/js/sw.js

Slide 140

Slide 140

Service Worker Scope https://example.com/js/sw.js https://example.com/sw.js

Slide 141

Slide 141

Service Worker Scope https://example.com/js/sw.js https://example.com/sw.js https://example.com/myapp/sw.js

Slide 142

Slide 142

Registering a Service Worker

Slide 143

Slide 143

Registering a Service Worker

<link rel=“serviceworker” href=“/sw.js”>

Slide 144

Slide 144

Registering a Service Worker

<link rel=“serviceworker” href=“/sw.js”> <script> navigator.serviceWorker.register(‘/sw.js’); </script>

Slide 145

Slide 145

Service Worker support

Slide 146

Slide 146

Service Worker support https://caniuse.com/#search=service%20worker

Slide 147

Slide 147

Feature Detection

Slide 148

Slide 148

Feature Detection

<script>

Slide 149

Slide 149

Feature Detection

<script> if (navigator.serviceWorker) {

Slide 150

Slide 150

Feature Detection

<script> if (navigator.serviceWorker) { navigator.serviceWorker.register('/sw.js')

Slide 151

Slide 151

Feature Detection

<script> if (navigator.serviceWorker) { navigator.serviceWorker.register('/sw.js') } </script>

Slide 152

Slide 152

Inside the Service Worker

Slide 153

Slide 153

Inside the Service Worker const version = 'v0.01';

Slide 154

Slide 154

Inside the Service Worker const version = 'v0.01'; const staticCacheName = 'staticfiles';

Slide 155

Slide 155

Inside the Service Worker const version = 'v0.01'; const staticCacheName = 'staticfiles'; addEventListener('install', installEvent !=> {

Slide 156

Slide 156

Inside the Service Worker const version = 'v0.01'; const staticCacheName = 'staticfiles'; addEventListener('install', installEvent !=> { installEvent.waitUntil(

Slide 157

Slide 157

Inside the Service Worker const version = 'v0.01'; const staticCacheName = 'staticfiles'; addEventListener('install', installEvent !=> { installEvent.waitUntil( caches.open(staticCacheName)

Slide 158

Slide 158

Inside the Service Worker const version = 'v0.01'; const staticCacheName = 'staticfiles'; addEventListener('install', installEvent !=> { installEvent.waitUntil( caches.open(staticCacheName) .then( staticCache !=> {

Slide 159

Slide 159

Inside the Service Worker const version = 'v0.01'; const staticCacheName = 'staticfiles'; addEventListener('install', installEvent !=> { installEvent.waitUntil( caches.open(staticCacheName) .then( staticCache !=> { return staticCache.addAll([ ‘https:!//example.com/css/style.css', ‘https:!//example.com/js/scripts.js', ‘https:!//example.com/images/banner.jpg'

Slide 160

Slide 160

Inside the Service Worker const version = 'v0.01'; const staticCacheName = 'staticfiles'; addEventListener('install', installEvent !=> { installEvent.waitUntil( caches.open(staticCacheName) .then( staticCache !=> { return staticCache.addAll([ ‘https:!//example.com/css/style.css', ‘https:!//example.com/js/scripts.js', ‘https:!//example.com/images/banner.jpg' ]); !// end return addAll }) !// end open then ); !// end waitUntil }); !// end addEventListener

Slide 161

Slide 161

Inside the Service Worker

Slide 162

Slide 162

Inside the Service Worker addEventListener('fetch', fetchEvent !=> { const request = fetchEvent.request; fetchEvent.respondWith( !// first look in the cache caches.match(request) .then ( responseFromCache !=> { if (responseFromCache) { return responseFromCache; } !// end if !// Otherwise fetch from the network return fetch(request); }) !// end match then ); !// end respondWith }); !// end addEventListener

Slide 163

Slide 163

Service Worker Cookbook

Slide 164

Slide 164

Service Worker Cookbook https://serviceworke.rs/

Slide 165

Slide 165

Offline using Service Worker

Slide 166

Slide 166

Offline using Service Worker https://matrix.squiz.co.uk/h2g2/index.html

Slide 167

Slide 167

Offline using Service Worker

Slide 168

Slide 168

Offline using Service Worker https://matrix.squiz.co.uk/h2g2/index.html

Slide 169

Slide 169

Offline using Service Worker

Slide 170

Slide 170

Offline using Service Worker https://matrix.squiz.co.uk/h2g2/index.html

Slide 171

Slide 171

PWA Size

Slide 172

Slide 172

PWA Size https://matrix.squiz.co.uk/h2g2/index.html

Slide 173

Slide 173

Web App Manifest

Slide 174

Slide 174

Manifest support

Slide 175

Slide 175

Manifest support https://caniuse.com/#search=web%20app%20manifest

Slide 176

Slide 176

Registering a Manifest

Slide 177

Slide 177

Registering a Manifest

<link rel=“manifest” href=“/manifest.json”>

Slide 178

Slide 178

Manifest https://developers.google.com/web/fundamentals/web-app-manifest/

Slide 179

Slide 179

Manifest { "lang": "en", https://developers.google.com/web/fundamentals/web-app-manifest/

Slide 180

Slide 180

Manifest { "lang": "en", "name": "The Hitch Hikers Guide to PWAs", https://developers.google.com/web/fundamentals/web-app-manifest/

Slide 181

Slide 181

Manifest { "lang": "en", "name": "The Hitch Hikers Guide to PWAs", "short_name": "H2G2 PWAs", https://developers.google.com/web/fundamentals/web-app-manifest/

Slide 182

Slide 182

Manifest { "lang": "en", "name": "The Hitch Hikers Guide to PWAs", "short_name": "H2G2 PWAs", "description": "This ia a PWA about PWAs that supports Dave's Squiz Summit Talk", https://developers.google.com/web/fundamentals/web-app-manifest/

Slide 183

Slide 183

Manifest { "lang": "en", "name": "The Hitch Hikers Guide to PWAs", "short_name": "H2G2 PWAs", "description": "This ia a PWA about PWAs that supports Dave's Squiz Summit Talk", "theme_color": "#222222", https://developers.google.com/web/fundamentals/web-app-manifest/

Slide 184

Slide 184

Manifest { "lang": "en", "name": "The Hitch Hikers Guide to PWAs", "short_name": "H2G2 PWAs", "description": "This ia a PWA about PWAs that supports Dave's Squiz Summit Talk", "theme_color": "#222222", "background_color": "#222222", https://developers.google.com/web/fundamentals/web-app-manifest/

Slide 185

Slide 185

Manifest { "lang": "en", "name": "The Hitch Hikers Guide to PWAs", "short_name": "H2G2 PWAs", "description": "This ia a PWA about PWAs that supports Dave's Squiz Summit Talk", "theme_color": "#222222", "background_color": "#222222", "start_url": “/h2g2/index.html”, https://developers.google.com/web/fundamentals/web-app-manifest/

Slide 186

Slide 186

Manifest { "lang": "en", "name": "The Hitch Hikers Guide to PWAs", "short_name": "H2G2 PWAs", "description": "This ia a PWA about PWAs that supports Dave's Squiz Summit Talk", "theme_color": "#222222", "background_color": "#222222", "start_url": “/h2g2/index.html”, "display": "standalone", https://developers.google.com/web/fundamentals/web-app-manifest/

Slide 187

Slide 187

Manifest { } "lang": "en", "name": "The Hitch Hikers Guide to PWAs", "short_name": "H2G2 PWAs", "description": "This ia a PWA about PWAs that supports Dave's Squiz Summit Talk", "theme_color": "#222222", "background_color": "#222222", "start_url": “/h2g2/index.html”, "display": "standalone", "icons": [ { "src": "/images/small-icon.png", "sizes": "48x48", "type": "image/png" }, { "src": "/images/large-icon.png", "sizes": "512x512", "type": "image/png" } ] https://developers.google.com/web/fundamentals/web-app-manifest/

Slide 188

Slide 188

Manifest { } "lang": "en", "name": "The Hitch Hikers Guide to PWAs", "short_name": "H2G2 PWAs", "description": "This ia a PWA about PWAs that supports Dave's Squiz Summit Talk", "theme_color": "#222222", "background_color": "#222222", "start_url": “/h2g2/index.html”, "display": "standalone", "icons": [ { "src": "/images/small-icon.png", "sizes": "48x48", "type": "image/png" }, { "src": "/images/large-icon.png", "sizes": "512x512", "type": "image/png" } ] https://developers.google.com/web/fundamentals/web-app-manifest/

Slide 189

Slide 189

Display

Slide 190

Slide 190

“display”: ”browser” Display

Slide 191

Slide 191

“display”: “standalone” “display”: ”browser” Display

Slide 192

Slide 192

“display”: “fullscreen” “display”: “standalone” “display”: ”browser” Display

Slide 193

Slide 193

Splash Screen

Slide 194

Slide 194

Splash Screen https://matrix.squiz.co.uk/h2g2/index.html

Slide 195

Slide 195

PWA Tools

Slide 196

Slide 196

PWA Tools https://developers.google.com/web/tools/lighthouse/

Slide 197

Slide 197

PWA Tools

Slide 198

Slide 198

PWA Tools https://developers.google.com/web/tools/lighthouse/

Slide 199

Slide 199

PWA Tools https://developers.google.com/web/tools/lighthouse/

Slide 200

Slide 200

PWA Tools https://developers.google.com/web/tools/lighthouse/

Slide 201

Slide 201

PWAs Still to come

Slide 202

Slide 202

Badging

Slide 203

Slide 203

Badging https://twitter.com/kennethrohde/status/1046889939198197760

Slide 204

Slide 204

Phone Authentication

Slide 205

Slide 205

Phone Authentication https://www.w3.org/2018/04/pressrelease-webauthn-fido2.html.en

Slide 206

Slide 206

PWA Examples

Slide 207

Slide 207

Finacial Times

Slide 208

Slide 208

Finacial Times https://app.ft.com

Slide 209

Slide 209

Finacial Times https://app.ft.com

Slide 210

Slide 210

Finacial Times https://app.ft.com

Slide 211

Slide 211

Pintrest

Slide 212

Slide 212

Pintrest https://medium.com/@Pinterest_Engineering/a-one-year-pwa-retrospective-f4a2f4129e05

Slide 213

Slide 213

Pintrest Effect of launching a PWA https://medium.com/@Pinterest_Engineering/a-one-year-pwa-retrospective-f4a2f4129e05

Slide 214

Slide 214

Pintrest Effect of launching a PWA •Weekly active users on mobile web have increased 103% year-over-year overall https://medium.com/@Pinterest_Engineering/a-one-year-pwa-retrospective-f4a2f4129e05

Slide 215

Slide 215

Pintrest Effect of launching a PWA •Weekly active users on mobile web have increased 103% year-over-year overall •156% increase in Brazil https://medium.com/@Pinterest_Engineering/a-one-year-pwa-retrospective-f4a2f4129e05

Slide 216

Slide 216

Pintrest Effect of launching a PWA •Weekly active users on mobile web have increased 103% year-over-year overall •156% increase in Brazil •312% increase in India https://medium.com/@Pinterest_Engineering/a-one-year-pwa-retrospective-f4a2f4129e05

Slide 217

Slide 217

Pintrest Effect of launching a PWA •Weekly active users on mobile web have increased 103% year-over-year overall •156% increase in Brazil •312% increase in India •296% increase in session length https://medium.com/@Pinterest_Engineering/a-one-year-pwa-retrospective-f4a2f4129e05

Slide 218

Slide 218

Pintrest Effect of launching a PWA •Weekly active users on mobile web have increased 103% year-over-year overall •156% increase in Brazil •312% increase in India •296% increase in session length •401% increase in Pins seen https://medium.com/@Pinterest_Engineering/a-one-year-pwa-retrospective-f4a2f4129e05

Slide 219

Slide 219

Pintrest Effect of launching a PWA •Weekly active users on mobile web have increased 103% year-over-year overall •156% increase in Brazil •312% increase in India •296% increase in session length •401% increase in Pins seen •295% of users more likely to save a pin https://medium.com/@Pinterest_Engineering/a-one-year-pwa-retrospective-f4a2f4129e05

Slide 220

Slide 220

Pintrest Effect of launching a PWA •Weekly active users on mobile web have increased 103% year-over-year overall •156% increase in Brazil •312% increase in India •296% increase in session length •401% increase in Pins seen •295% of users more likely to save a pin •370% increase in logins https://medium.com/@Pinterest_Engineering/a-one-year-pwa-retrospective-f4a2f4129e05

Slide 221

Slide 221

Pintrest Effect of launching a PWA •Weekly active users on mobile web have increased 103% year-over-year overall •156% increase in Brazil •312% increase in India •296% increase in session length •401% increase in Pins seen •295% of users more likely to save a pin •370% increase in logins •843% increase in signups https://medium.com/@Pinterest_Engineering/a-one-year-pwa-retrospective-f4a2f4129e05

Slide 222

Slide 222

Pintrest Effect of launching a PWA •Weekly active users on mobile web have increased 103% year-over-year overall •156% increase in Brazil •312% increase in India •296% increase in session length •401% increase in Pins seen •295% of users more likely to save a pin •370% increase in logins •843% increase in signups •In 6 month 800k weekly users using our PWA like a native app (from their homescreen) https://medium.com/@Pinterest_Engineering/a-one-year-pwa-retrospective-f4a2f4129e05

Slide 223

Slide 223

Uber

Slide 224

Slide 224

Uber https://eng.uber.com/m-uber/

Slide 225

Slide 225

What we’ve covered

Slide 226

Slide 226

What we’ve covered • The Web continues to win

Slide 227

Slide 227

What we’ve covered • The Web continues to win • What are PWAs

Slide 228

Slide 228

What we’ve covered • The Web continues to win • What are PWAs • Why PWAs

Slide 229

Slide 229

What we’ve covered • The Web continues to win • What are PWAs • Why PWAs • PWAs the Technology

Slide 230

Slide 230

What we’ve covered • The Web continues to win • What are PWAs • Why PWAs • PWAs the Technology • Still to come

Slide 231

Slide 231

What we’ve covered • The Web continues to win • What are PWAs • Why PWAs • PWAs the Technology • Still to come • PWA Examples

Slide 232

Slide 232

Check out the Summit App

Slide 233

Slide 233

Check out the Summit App http://example.com

Slide 234

Slide 234

THE HITCHHIKERS GUIDE TO PROGRESSIVE WEB APPS Dave Letorey Matrix Evangelist