Top Banner
The Web - What it Has, What it Lacks and Where it Must Go @robertnyman
91

The web - What it has, what it lacks and where it must go

Apr 08, 2017

Download

Internet

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: The web - What it has, what it lacks and where it must go

The Web - What it Has, What it Lacks and Where it Must Go @robertnyman

Page 2: The web - What it has, what it lacks and where it must go

Our line of work

Page 3: The web - What it has, what it lacks and where it must go

Face recognition

Page 4: The web - What it has, what it lacks and where it must go

Experience

Page 5: The web - What it has, what it lacks and where it must go

Trends

Page 6: The web - What it has, what it lacks and where it must go

My role at Google

Page 7: The web - What it has, what it lacks and where it must go

My role at Google

https://developers.google.com/android/

https://developers.google.com/ios/

https://developers.google.com/web/

Page 8: The web - What it has, what it lacks and where it must go

My role at Google

Page 9: The web - What it has, what it lacks and where it must go

My role at Google - https://medium.com/latest-from-google

Page 10: The web - What it has, what it lacks and where it must go

The web as of today The web vs. native

Tools & resources from Google SLICE

Why do developers need a native app? Monetization

Future of the web

Page 11: The web - What it has, what it lacks and where it must go

The web as of today

Page 12: The web - What it has, what it lacks and where it must go

The web as of today

Page 14: The web - What it has, what it lacks and where it must go

The web as of today

One billion active users

Page 15: The web - What it has, what it lacks and where it must go

The web as of today

Morgan Stanley: the web is winning

Page 16: The web - What it has, what it lacks and where it must go

The web vs. native

Page 17: The web - What it has, what it lacks and where it must go

The web vs. native

comScore: 87% of time on mobile spent in appsNative is winning

Page 18: The web - What it has, what it lacks and where it must go

The web vs. native

10% of time on mobile spent in the browser

Page 19: The web - What it has, what it lacks and where it must go

The web vs. native

10% of time on mobile spent in the browser

Page 20: The web - What it has, what it lacks and where it must go

The web vs. native

?

Page 22: The web - What it has, what it lacks and where it must go

The web vs. native

Facebook

One billion daily users,

where 844 million daily users are on mobile

Page 23: The web - What it has, what it lacks and where it must go

The web vs. native

…and these also have more than one billion users:

Page 24: The web - What it has, what it lacks and where it must go

The web vs. native

Visitor traffic to top companies/services

Page 25: The web - What it has, what it lacks and where it must go

The web vs. native

Page 26: The web - What it has, what it lacks and where it must go

The web vs. native

Page 27: The web - What it has, what it lacks and where it must go

Tools & measures from

Google

Page 28: The web - What it has, what it lacks and where it must go

App install interstitials being

non-mobile friendly

Page 29: The web - What it has, what it lacks and where it must go

App install interstitials being non-mobile friendly

Page 30: The web - What it has, what it lacks and where it must go

Mobile-Friendly Test

Page 31: The web - What it has, what it lacks and where it must go

Mobile-Friendly Test

https://www.google.com/webmasters/tools/mobile-friendly/

Page 32: The web - What it has, what it lacks and where it must go

Communications & the web

Page 34: The web - What it has, what it lacks and where it must go

Communications & the web

https://hangouts.google.com/

Page 35: The web - What it has, what it lacks and where it must go

Communications & the web

WebRTC

Desktop:Microsoft EdgeGoogle ChromeMozilla FirefoxOpera 18

Android:Google ChromeMozilla FirefoxOpera Mobile

Chrome OSFirefox OS

Page 36: The web - What it has, what it lacks and where it must go

Chrome DevTools

Page 37: The web - What it has, what it lacks and where it must go

Chrome DevTools

https://developers.google.com/web/tools/chrome-devtools/

Page 38: The web - What it has, what it lacks and where it must go

Web Fundamentals

Page 39: The web - What it has, what it lacks and where it must go

Web Fundamentals

https://developers.google.com/web/fundamentals/

Page 40: The web - What it has, what it lacks and where it must go

Chrome Custom Tabs

Page 41: The web - What it has, what it lacks and where it must go

Chrome Custom Tabs

https://developer.chrome.com/multidevice/android/customtabs

Page 42: The web - What it has, what it lacks and where it must go

SLICE

Page 43: The web - What it has, what it lacks and where it must go

Google influencers

Paul Kinlan Jake Archibald Alex Russell Paul Lewis Paul Irish + many more

Page 44: The web - What it has, what it lacks and where it must go

The web, moving forward

Build instantly engaging sites and apps without the need for a mandatory app download

Page 47: The web - What it has, what it lacks and where it must go

SLICE

Indexable

Page 50: The web - What it has, what it lacks and where it must go

Why do developers need a native app?

Page 51: The web - What it has, what it lacks and where it must go

Performance

Sensors

OS-specific features

Offline access

Periodic background processing

Notifications

Why do developers need a native app?

From Brian Kennan

Page 52: The web - What it has, what it lacks and where it must go

Performance

Sensors

OS-specific features

Offline access

Periodic background processing

Notifications

Why do developers need a native app?

From Brian Kennan

Page 53: The web - What it has, what it lacks and where it must go

Initiatives to address this

New web features

Page 54: The web - What it has, what it lacks and where it must go

Offline access =>

Service Workers

Service Workers

Page 55: The web - What it has, what it lacks and where it must go

It's a JavaScript Worker, so it can't access the DOM directly. Instead responds to postMessages

Service worker is a programmable network proxy

It will be terminated when not in use, and restarted when it's next needed

Makes extensive use of Promises

Service Workers

Page 56: The web - What it has, what it lacks and where it must go

HTTPS is Needed

Service Workers

Page 57: The web - What it has, what it lacks and where it must go

Register and Installing a Service Worker

if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/sw.js').then(function(registration) { // Registration was successful console.log('ServiceWorker registration successful with scope: ', registration.scope); }).catch(function(err) { // registration failed :( console.log('ServiceWorker registration failed: ', err); });}

Page 58: The web - What it has, what it lacks and where it must go

chrome://inspect/#service-workers

Service Workers

Page 59: The web - What it has, what it lacks and where it must go

// The files we want to cachevar urlsToCache = [ '/', '/styles/main.css', '/script/main.js']; // Set the callback for the install stepself.addEventListener('install', function(event) { // Perform install steps});

Installing a Service Worker

Page 60: The web - What it has, what it lacks and where it must go

Inside our install callback:

1. Open a cache 2. Cache our files 3. Confirm whether all the required assets are cached or not

Installing a Service Worker

Page 61: The web - What it has, what it lacks and where it must go

Install callback

var CACHE_NAME = 'my-site-cache-v1'; var urlsToCache = [ '/', '/styles/main.css', '/script/main.js']; self.addEventListener('install', function(event) { // Perform install steps event.waitUntil( caches.open(CACHE_NAME) .then(function(cache) { console.log('Opened cache'); return cache.addAll(urlsToCache); }) );});

Page 62: The web - What it has, what it lacks and where it must go

self.addEventListener('fetch', function(event) { event.respondWith( caches.match(event.request) .then(function(response) { // Cache hit - return response if (response) { return response; } return fetch(event.request); } ) );});

Caching and Returning Requests

Page 63: The web - What it has, what it lacks and where it must go

Updating a Service Worker

Page 64: The web - What it has, what it lacks and where it must go

1. Update your service worker JavaScript file. 2. Your new service worker will be started and the

install event will be fired. 3. New Service Worker will enter a "waiting" state 4. When open pages are closed, the old Service

Worker will be killed - new service worker will take control.

5. Once new Service Worker takes control, its activate event will be fired.

Updating a Service Worker

Page 65: The web - What it has, what it lacks and where it must go

Periodic background processing =>

BackgroundSync

Page 66: The web - What it has, what it lacks and where it must go

Web Background Synchronization

https://slightlyoff.github.io/BackgroundSync/spec/

Page 67: The web - What it has, what it lacks and where it must go

Notifications =>

Push notifications

Page 68: The web - What it has, what it lacks and where it must go

Push notifications

Page 69: The web - What it has, what it lacks and where it must go

// Are Notifications supported in the service worker? if (!('showNotification' in ServiceWorkerRegistration.prototype)) { console.warn('Notifications aren\'t supported.'); return; }

Push notifications

Page 70: The web - What it has, what it lacks and where it must go

// Check the current Notification permission. // If its denied, it's a permanent block until the // user changes the permission if (Notification.permission === 'denied') { console.warn('The user has blocked notifications.'); return; }

Push notifications

Page 71: The web - What it has, what it lacks and where it must go

// Check if push messaging is supported if (!('PushManager' in window)) { console.warn('Push messaging isn\'t supported.'); return; }

Push notifications

Page 72: The web - What it has, what it lacks and where it must go

// We need the service worker registration to check for a subscription navigator.serviceWorker.ready.then(function(serviceWorkerRegistration) { // Do we already have a push message subscription? serviceWorkerRegistration.pushManager.getSubscription() .then(function(subscription) { // Enable any UI which subscribes / unsubscribes from // push messages. var pushButton = document.querySelector('.js-push-button'); pushButton.disabled = false; if (!subscription) { // We aren't subscribed to push, so set UI // to allow the user to enable push return; } // Keep your server in sync with the latest subscriptionId sendSubscriptionToServer(subscription); // Set your UI to show they have subscribed for // push messages pushButton.textContent = 'Disable Push Messages'; isPushEnabled = true; }) .catch(function(err) { console.warn('Error during getSubscription()', err); }); }); Push notifications

Page 73: The web - What it has, what it lacks and where it must go

{ "name": "Push Demo", "short_name": "Push Demo", "icons": [{ "src": "images/icon-192x192.png", "sizes": "192x192", "type": "image/png" }], "start_url": "/index.html?homescreen=1", "display": "standalone"}

<link rel="manifest" href="manifest.json">

Push notifications

Page 74: The web - What it has, what it lacks and where it must go

Add to Homescreen

Page 75: The web - What it has, what it lacks and where it must go

Cache management & whitelistsApp Install Banners

Page 76: The web - What it has, what it lacks and where it must go

App Install Banners prerequisites

You have a web app manifest file

You have a service worker registered on your site. We recommend a simple custom offline page service worker

Your site is served over HTTPS (you need a service worker after all)

The user has visited your site twice over two separate days during the course of two weeks.

Page 77: The web - What it has, what it lacks and where it must go

All this leads to progressive

apps

Page 78: The web - What it has, what it lacks and where it must go

Progressive Apps

These apps aren’t packaged and deployed through stores, they’re just websites that took all the right vitamins.

They keep the web’s ask-when-you-need-it permission model and add in new capabilities like being top-level in your task switcher, on your home screen, and in your notification tray

- Alex Russell

Page 79: The web - What it has, what it lacks and where it must go

Monetization

Page 80: The web - What it has, what it lacks and where it must go

Future of the web

Page 81: The web - What it has, what it lacks and where it must go

Future of the web

WAWKI-

Web as We Know It

Page 82: The web - What it has, what it lacks and where it must go

Future of the web

Why the web?

Page 83: The web - What it has, what it lacks and where it must go

Future of the web

Native platforms needs to be matched and surpassed

Page 84: The web - What it has, what it lacks and where it must go

Future of the web

Getting people back to using URLs, sharing things online and making it

accessible across all platforms

Page 85: The web - What it has, what it lacks and where it must go

Future of the web

Go simple

Page 86: The web - What it has, what it lacks and where it must go

Future of the web

Go simple

Right now the onboarding process for a (front-end) web developer is much harder than it

was before

Page 87: The web - What it has, what it lacks and where it must go

Future of the web

Go simple

We've gone from HTML, CSS and JavaScript to incredibly complex solutions, build scripts &

workflows

Page 88: The web - What it has, what it lacks and where it must go

Future of the web

Spread the word about what the web can do

Page 89: The web - What it has, what it lacks and where it must go

Future of the web

Longevity of the web

Where stuff being built will still work 10 years down the line