Top Banner
Proprietary + Confidential Introduction to Progressive Web Apps @robertnyman
73

Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Apr 16, 2017

Download

Technology

Robert Nyman
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Proprietary + Confidential

Introduction to Progressive Web Apps

@robertnyman

Page 2: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryHello everyone!

안녕하세요!

Page 3: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

로버트입니다

I am Robert

Page 4: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryI’m from Sweden - 저는 스웨덴에서 왔어요

Page 5: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

9 million people

If I lived in South Korea, I would:

- Be 60.49% less likely to be unemployed - Spend 67.99% less money on health care - Use 34.47% less electricity - Be 11.11% less likely to be murdered

50 million people

If you lived in Sweden, you would:

- Have 28.87% more free time - Make 23.19% more money - Consume 30.7% less oil - Live 2.09 years longer

South Korea - Sweden

Page 6: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietarySomething I recognize

Page 7: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryI am an IT professional

Page 8: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

The web

A brief history lesson

Page 9: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

HTML + HTTP and Documents

19911993

19961997

2004 2007 20142005 2008

A brief history lesson2016

Page 10: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Common Gateway Interface

19911993

19961997

2004 2007 20142005 2008

A brief history lesson 2016

Page 11: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Peak CGI

19911993

19961997

2004 2007 20142005 2008

A brief history lesson 2016

Page 12: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

XMLHTTP

web.archive.org/web/20070623125327/http://www.alexhopmann.com/xmlhttp.htm

19911993

19961997

2004 2007 20142005 2008

A brief history lesson 2016

Page 13: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Gmail

19911993

19961997

2004 2007 20142005 2008

A brief history lesson 2016

Page 14: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

AJAX

19911993

19961997

2004 2007 20142005 2008

A brief history lesson 2016

Page 15: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Mobile hits town with the iPhone

19911993

19961997

2004 2007 20142005 2008

A brief history lesson 2016

Page 16: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Mobile == Apps

19911993

19961997

2004 2007 20142005 2008

A brief history lesson 2016

Page 17: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Service Worker

19911993

19961997

2004 2007 20142005 2008

A brief history lesson 2016

Page 18: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

?

19911993

19961997

2004 2007 201420162005 2008

A brief history lesson

Page 19: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryWeb declared dead in 2010

Page 20: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryWeb very much alive in 2016

Page 21: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryNov 2015, 800 million users

Page 22: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryApr 2016, 1 Billion users

Page 23: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryWeb is all browsers

Page 24: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Native & the web

Page 25: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryWeb traffic twice as much as native

Page 26: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryOnly 10% time spent in browser

Page 27: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryThings could be easier

Page 28: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryReducing friction

Every Step Costs You 20% of Users

- Gabor Cselle

Page 29: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Impact of speed on bounce rates

Source: SOASTA; September, 2015

2.4 2.7 3.0 3.3 3.6 3.9 4.2 4.5 4.8 5.1 5.4 5.7 6.0 6.3 6.6 6.9 7.2 7.5 7.8 8.1 8.4 8.7 9.0 9.3 9.6 9.9

180,000

140,000

100,000

60,000

0

20,000

58

45

32

19

0

6

Sess

ions

Load time (in seconds)

Boun

ce ra

te (%

)

Sessions Bounce rate

13%bounce

rate

20%bounce

rate

58%bounce

rate

Performance

Page 30: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

RAIL: Instant loading and smooth navigation

For first visitors, load pages in <10s on 3G net

Aspirational goal: <3s to first paint

For repeat visitors, loading of page in <500 ms Always scrolling at 60 frames/second Content shouldn’t jump as images are loaded

Performance

Page 31: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

SLICE

Page 32: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Build instantly engaging sites and apps without the need for a

mandatory app download

SLICE

Page 33: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietarySecure

Page 34: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryLinkable

Page 35: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryIndexable

Page 36: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryComposable

Page 37: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryEphemeral

Page 38: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Why do developers need a native app?

Page 39: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Performance Offline access Periodic background processing Notifications Sensors OS-specific features

From Brett Cannon

Why do developers need a native app?

Page 40: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Performance Offline access Periodic background processing Notifications Sensors OS-specific features

Why do developers need a native app?

Page 41: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Progressive Web Apps

Page 42: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Reliable: Fast loading, works on flaky networksFast: Smooth animation, scrolling and navEngaging and integrated

On the home screen, no URL bar, icons, splash Re-engaging with push notifications

Consistent experience across browsers(still in progress, though)

The Progressive Web App Experience

Progressive Web Apps

Page 43: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Client-side proxy in JavaScript

Net requests, but also push & sync

Service Workers

Progressive Web Apps

Page 44: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & ProprietaryProgressive Web Apps

Page 45: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Web App Manifests

Progressive Web Apps

<meta name="theme-color" content="#303F9F"><link rel="manifest" href="manifest.json">

Page 46: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Web App Manifests

Progressive Web Apps

{ "short_name": "Air Horner", "name": "Air Horner", "start_url": "/", "display": "standalone", "orientation": "portrait", "icons": [{ "src": "icons/icon-192.png", "sizes": "192x192", "type": "image/png" }]}

Page 47: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Add to Homescreen and launch in full-screen mode

User who visits 2x in a given time period will be prompted with “add to homescreen”

One tap to add to homescreen

Opens full screen (no URL bar)

Progressive Web Apps

Page 48: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Web push notifications

System level notifications, like apps

Ask to notify users with specific information

Can send notifications even when page closed

Progressive Web Apps

Page 49: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Progressive Web App technologies

Required Recommended Features

Service Worker Push notifications

Web App Manifest App shell caching

Splash screen

Advanced Offline Support

Smooth navigation

“Progressive enhancement” with cross browser support

Progressive Web Apps

Page 50: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

PWAs can work across browsers

PWAs should work across all modern browsers

Service Worker available in Chrome, Opera, and Firefox; “High priority roadmap” for Microsoft Edge, Safari and UC Web exploring

7

Progressive Web Apps

Page 51: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Security - HTTPS

Page 52: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Alex Martinez unsplash.com Security - HTTPS

Page 53: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Source: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis non erat sem

Do you know if any ISP’s or other services are injecting Ads or anything else in to your site? Paul Kinlan | bit.ly/content-injection

“”

Source: https://paul.kinlan.me/detecting-injected-content/Security - HTTPS

Page 54: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Features

Service workers ● Offline ● Push ● Background Sync ● ....???

Source: https://paul.kinlan.me/detecting-injected-content/Security - HTTPS

Page 55: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Features

Add to homescreen HTTP2 Brotli getUserMedia() Geolocation

Source: https://paul.kinlan.me/detecting-injected-content/Security - HTTPS

Page 56: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Adding HTTPS to your web site

Page 57: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Adding HTTPS to your web site

Page 58: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Adding HTTPS to your web site

Page 59: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

letsencrypt.org

letsencrypt.readthedocs.org

Adding HTTPS to your web site

Page 60: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Adding HTTPS to your web site

Page 61: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Deployment

Adding HTTPS to your web site

Page 62: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Deployment

Adding HTTPS to your web site

Page 63: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Source: http://bit.ly/ssl-config-gen

bit.ly/ssl-config-gen

Adding HTTPS to your web site

Page 64: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

bit.ly/ssl-labs

Adding HTTPS to your web site

Page 65: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Localhost

Adding HTTPS to your web site

Page 66: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

DevTools

Adding HTTPS to your web site

Page 67: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

More Info

Security Docs

bit.ly/security-docs

HTTPS: The Green Lock and Beyond

bit.ly/green-lock-beyond

Adding HTTPS to your web site

Page 68: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Use cases

Page 69: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Flipkart: Early results

App

3x time spent on site, from 1 minute to 3.5 minutes

Seeing 40% visitors return week over week

Users love smooth experience on 2G & flaky networks

Use cases

Page 70: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Google Developer Experts

Page 71: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

GitHub contributions to open source projects

StackOverflow reputation

Conference Speaker

Event Organizer

Well versed in the fundamentals of Web Development

Familiarity with new standards as they’re coming into web browsers

Page 72: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

Page 73: Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South Korea

Confidential & Proprietary

robertnyman.com

[email protected]

@robertnyman감사합니다!

Thank you!