Slide 1

Slide 1 text

Getting started with Progressive Web Apps

Slide 2

Slide 2 text

Photo goes here Vitor Alencar Desenvolvedor com foco em tecnologias novas e escaláveis, graduando em sistemas de informação,Co fundador do DEV I/O FOR , Google developer groups organizer e Organizado do Front-in Fortaleza @vitormalencar GURU-CE

Slide 3

Slide 3 text

flickr.com/photos/monado/4405843023

Slide 4

Slide 4 text

This amazing software

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

vs. Source: comScore Mobile Metrix, U.S., Age 18+, June 2015 13% 87% Mobile web Apps

Slide 10

Slide 10 text

80% OF TIME SPENT IS IN USERS’ TOP 3 APPS Source: comScore Mobile Metrix, U.S., Age 18+, June 2015

Slide 11

Slide 11 text

Capability Reach

Slide 12

Slide 12 text

ZERO NUMBER OF APPS AVERAGE USER INSTALLS PER MONTH Source: comScore Mobile Metrix, U.S., Age 18+, June 2015

Slide 13

Slide 13 text

Capability Reach

Slide 14

Slide 14 text

Capability Reach

Slide 15

Slide 15 text

are a new level of caring about the quality of your user experience Progressive Web Apps

Slide 16

Slide 16 text

Reliable User experiences need to be...

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

Lie-Fi

Slide 21

Slide 21 text

Reliability means never showing the offline dinosaur

Slide 22

Slide 22 text

Reliable Fast User experiences need to be...

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

of users abandon sites that take longer than 3 seconds to load 53%

Slide 27

Slide 27 text

Reliable Fast Engaging User experiences need to be...

Slide 28

Slide 28 text

Full screen, theming, orientation, etc. Push notifications Immersive Notifications Engaging Auto-adding to Home Screen Home Screen

Slide 29

Slide 29 text

` Web Push Notifications

Slide 30

Slide 30 text

` No surprises!

Slide 31

Slide 31 text

https://wapo.com/pw a https://wapo.com/pw a

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

` 80ms article page load time in the Progressive Web App Poynter article

Slide 39

Slide 39 text

Reliable Fast Engaging Progressive Web Apps are…

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

How do I get started?

Slide 45

Slide 45 text

Stay Secure

Slide 46

Slide 46 text

` HTTPS: Secure connection between site and users

Slide 47

Slide 47 text

Trust Is this site who they claim to be? Data integrity Has anyone tampered with this page? User privacy Can anyone see my browsing behavior? Keeping Users Safe

Slide 48

Slide 48 text

Chrome DevTools Security Panel

Slide 49

Slide 49 text

Search Ranking Guidance bit.ly/https-migration

Slide 50

Slide 50 text

Use a Service Worker

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

WHAT ??

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

Web server

Slide 55

Slide 55 text

Service worker Client side proxy (written in JavaScript) Cache Web server

Slide 56

Slide 56 text

Service Worker Life Cycle • Adds app-like lifecycle to a page • Wakes up only when the OS says • Only responds to system events Activated Error Idle Active Terminated Install Register

Slide 57

Slide 57 text

Service Worker Life Cycle • Adds app-like lifecycle to a page • Wakes up only when the OS says • Only responds to system events Activated Error Idle Active Terminated Install Register

Slide 58

Slide 58 text

Service Worker Life Cycle • Adds app-like lifecycle to a page • Wakes up only when the OS says • Only responds to system events Activated Error Idle Active Terminated Install Register

Slide 59

Slide 59 text

Service Worker Life Cycle • Adds app-like lifecycle to a page • Wakes up only when the OS says • Only responds to system events Activated Error Idle Active Terminated Install Register

Slide 60

Slide 60 text

is for the SECOND load. Service Worker

Slide 61

Slide 61 text

Life Cycle of a Service Worker Installing the Service Worker 1st Page Load install idle

Slide 62

Slide 62 text

Life Cycle of a Service Worker Installing the Service Worker 2nd Page Load activated check for update

Slide 63

Slide 63 text

Life Cycle of a Service Worker Installing the Service Worker Close Page idle terminated activated

Slide 64

Slide 64 text

Life Cycle of a Service Worker Updating a Service Worker Load Page with Service Worker activated check for update

Slide 65

Slide 65 text

Life Cycle of a Service Worker Updating a Service Worker Load Page with Service Worker activated check for update install idle

Slide 66

Slide 66 text

Life Cycle of a Service Worker Updating a Service Worker Load Page with Service Worker activated check for update install idle

Slide 67

Slide 67 text

Caching strategies You are in control of the network

Slide 68

Slide 68 text

Cache, Falling Back to Network

Slide 69

Slide 69 text

Network, Falling Back to Cache

Slide 70

Slide 70 text

Cache then Network

Slide 71

Slide 71 text

Generic Fallback

Slide 72

Slide 72 text

Cache and Network Race

Slide 73

Slide 73 text

Caching strategies galore!

Slide 74

Slide 74 text

Engage Your Users

Slide 75

Slide 75 text

Add to Home Screen

Slide 76

Slide 76 text

Add To Home Screen Was Broken

Slide 77

Slide 77 text

Add To Home Screen Was Broken Required user interaction Buried deep in menus

Slide 78

Slide 78 text

Add To Home Screen Was Broken Required user interaction Buried deep in menus Where would it start? Dependent on bookmark

Slide 79

Slide 79 text

Add To Home Screen Was Broken Required user interaction Buried deep in menus Where would it start? Dependent on bookmark Would it work offline? Users didn't expect offline

Slide 80

Slide 80 text

{ "name": "The Washington Post", "short_name": "Wash Post", "icons": [{ "src": "icon-48x48.png", "sizes": "48x48", "type": "image/png" }, {...}], "start_url": "/index.html", "display": "standalone", "orientation": "portrait", "background_color": "#000000", "theme_color": "#000000" }

Slide 81

Slide 81 text

manifest.json { "name": "The Washington Post", "short_name": "Wash Post", "icons": [{ "src": "icon-48x48.png", "sizes": "48x48", "type": "image/png" }, {...}], "start_url": "/index.html", "display": "standalone", "orientation": "portrait", "background_color": "#000000", "theme_color": "#000000" }

Slide 82

Slide 82 text

manifest.json { "name": "The Washington Post", "short_name": "Wash Post", "icons": [{ "src": "icon-48x48.png", "sizes": "48x48", "type": "image/png" }, {...}], "start_url": "/index.html", "display": "standalone", "orientation": "portrait", "background_color": "#000000", "theme_color": "#000000" }

Slide 83

Slide 83 text

manifest.json { "name": "The Washington Post", "short_name": "Wash Post", "icons": [{ "src": "icon-48x48.png", "sizes": "48x48", "type": "image/png" }, {...}], "start_url": "/index.html", "display": "standalone", "orientation": "portrait", "background_color": "#000000", "theme_color": "#000000" }

Slide 84

Slide 84 text

manifest.json { "name": "The Washington Post", "short_name": "Wash Post", "icons": [{ "src": "icon-48x48.png", "sizes": "48x48", "type": "image/png" }, {...}], "start_url": "/index.html", "display": "standalone", "orientation": "portrait", "background_color": "#000000", "theme_color": "#000000" }

Slide 85

Slide 85 text

` Good, but what about prompt to install?

Slide 86

Slide 86 text

A Promise to the User Consistent Experience Works Offline The User is Engaged

Slide 87

Slide 87 text

` Web Push Notifications

Slide 88

Slide 88 text

` Web Push Notifications The browser doesn’t need to be open!

Slide 89

Slide 89 text

`

Slide 90

Slide 90 text

` 38% open rate 9x more conversions on previously abandoned carts

Slide 91

Slide 91 text

Anatomy of a notification I feel I need it and it matters right now. when: it's timely

Slide 92

Slide 92 text

Anatomy of a notification I feel I need it and it matters right now. when: it's timely

Slide 93

Slide 93 text

Anatomy of a notification when: it's timely what: it's precise It has specific info that’s good to know or act upon.

Slide 94

Slide 94 text

Anatomy of a notification when: it's timely what: it's precise what & who: it's relevant It’s from people or sources that matter to me, which makes it personal.

Slide 95

Slide 95 text

Built on Service Workers /* ServiceWorker.js */ onfetch = function(e) { if(e.request.url == "app.html") { e.respondWith( caches.match(e.request) ); } if(e.request.url == "content.json") { // go to the network for updates, // meanwhile, use cached content fetch(...).then(function(r) { r.asJSON().then(function(json) { e.client.postMessage(json); }); }); } }; GET /content.json HTTP/1.1 HOST example.com GET /content.json HTTP/1.1 HOST example.com GET /app.html HTTP/1.1 HOST example.com

Slide 96

Slide 96 text

Built on Service Workers /* ServiceWorker.js */ onpush = function(event) { var data = event.data.json(); var t = data.title; var opt = { body: data.body, icon: data.icon, tag: data.tag }; self.registration .showNotification(t, opt); }; End Point example.co m

Slide 97

Slide 97 text

Check out the Push code lab

Slide 98

Slide 98 text

Stay Secure

Slide 99

Slide 99 text

Use a Service Worker

Slide 100

Slide 100 text

Engage Your Users

Slide 101

Slide 101 text

`

Slide 102

Slide 102 text

` 2x more page views 74% increase in time spent

Slide 103

Slide 103 text

` 2x more page views 74% increase in time spent 82% more conversions on iOS

Slide 104

Slide 104 text

are progressive. Progressive Web Apps

Slide 105

Slide 105 text

are a new level of caring about the quality of your user experience Progressive Web Apps

Slide 106

Slide 106 text

to Establish a Baseline goo.gl/S07woZ Use Lighthouse

Slide 107

Slide 107 text

` 98% 1430.2ms First meaningful paint 94% 2069.4ms Time To Interactive 96% 1591 Perceptual Speed Index vitormalencar.com

Slide 108

Slide 108 text

Show me the metrics

Slide 109

Slide 109 text

Show me the metrics

Slide 110

Slide 110 text

` 100% 630.9ms First meaningful paint 99% 1210.8ms Time To Interactive 99% 1005 Perceptual Speed Index vitormalencar.com

Slide 111

Slide 111 text

Show me the metrics

Slide 112

Slide 112 text

…but not a destination! Lighthouse: Fantastic Tool

Slide 113

Slide 113 text

No content

Slide 114

Slide 114 text

http://bit.ly/1ksSnNS

Slide 115

Slide 115 text

http://bit.ly/2mbUaPN

Slide 116

Slide 116 text

http://bit.ly/2mpN0U2

Slide 117

Slide 117 text

No content

Slide 118

Slide 118 text

No content

Slide 119

Slide 119 text

Ready-to-rock Preact starter project http://bit.ly/2lKsK2g

Slide 120

Slide 120 text

https://pwa-directory.appspot.com/

Slide 121

Slide 121 text

No content

Slide 122

Slide 122 text

+vitormalencar @vitormalencar