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

The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Embed Size (px)

Citation preview

Page 1: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

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 - Bulgaria Web Summit, February 2016

2010

Page 3: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

2010

Page 4: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

2010

Page 5: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Party like it's 2010

Page 6: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016
Page 7: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Our line of work

Page 8: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

My role at Google

Page 9: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

My role at Google

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

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

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

Page 10: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

My role at Google

Page 11: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

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

Page 12: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

My role at Google - understanding trends

Page 13: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

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 14: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web as of today

Page 15: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web as of today

Page 17: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web as of today

One billion active users

Page 18: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web as of today

Page 19: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web as of today

Page 20: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web as of today

Morgan Stanley: the web is winning

Page 21: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web vs. native

Page 22: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web vs. native

Visitor traffic to top companies/services

Page 23: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web vs. native

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

Page 24: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web vs. native

10% of time on mobile spent in the browser

Page 25: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web vs. native

10% of time on mobile spent in the browser

Page 26: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web vs. native

?

Page 28: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web vs. native

Facebook

One billion daily users,

where 844 million daily users are on mobile

Page 29: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web vs. native

…and these 7 products also have more than one billion users:

Page 30: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web vs. native

Page 31: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web vs. native

Page 32: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Tools & measures from

Google

Page 33: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

App install interstitials being

non-mobile friendly

Page 34: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

App install interstitials being non-mobile friendly

Page 35: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Mobile-Friendly Test

Page 36: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Mobile-Friendly Test

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

Page 37: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Communications & the web

Page 39: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Communications & the web

https://hangouts.google.com/

Page 40: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Communications & the web

WebRTC

Desktop:Microsoft EdgeGoogle ChromeMozilla FirefoxOpera

Android:Google ChromeMozilla FirefoxOpera Mobile

Chrome OSFirefox OS

Page 41: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Chrome DevTools

Page 42: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Chrome DevTools

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

Page 43: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Web Fundamentals

Page 44: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Web Fundamentals

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

Page 45: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Chrome Custom Tabs

Page 46: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Chrome Custom Tabs

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

Page 47: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

SLICE

Page 48: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Google influencers

Paul Kinlan Jake Archibald Alex Russell Paul Lewis + many more

Page 49: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

The web, moving forward

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

Page 52: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

SLICE

Indexable

Page 55: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Why do developers need a native app?

Page 56: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Performance

Sensors

OS-specific features

Offline accessPeriodic background processing

Notifications

Why do developers need a native app?

From Brian Kennan

Page 57: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Performance

Sensors

OS-specific features

Offline access

Periodic background processing

Notifications

Why do developers need a native app?

From Brian Kennan

Page 58: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Initiatives to address this

New web features

Page 59: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Offline access =>

Service Workers

Service Workers

Page 60: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

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 61: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

HTTPS is Needed

Service Workers

Page 62: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

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 63: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

chrome://inspect/#service-workers chrome://serviceworker-internals/

Service Workers

Page 64: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

// 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 65: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

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 66: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

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 67: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

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 68: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Updating a Service Worker

Page 69: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

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 70: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Instant Loading Web Apps with An Application Shell Architecture

Application Shell

Page 73: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Periodic background processing =>

Background Sync

Page 75: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Background Sync

Chrome Dev for Android or Chrome Canary for desktop

chrome://flags/#enable-experimental-web-platform-features

Restart the browser

Page 76: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Notifications =>

Push notifications

Page 77: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Push notifications

Page 78: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

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

Push notifications

Page 79: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

// 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 80: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

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

Push notifications

Page 81: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

// 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 82: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

{ "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 83: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Add to Homescreen

Page 84: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Cache management & whitelistsApp Install Banners

Page 85: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

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 86: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

All this leads to progressive

apps

Page 87: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

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 90: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Monetization

Page 91: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Future of the web

Page 92: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Future of the web

Why the web?

Page 93: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Future of the web

Native platforms needs to be matched and surpassed

Page 94: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Future of the web

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

accessible across all platforms

Page 95: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Future of the web

Go simple

Page 96: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

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 97: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Future of the web

Go simple

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

workflows

Page 98: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Future of the web

Spread the word about what the web can do

Page 99: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Future of the web

Longevity of the web

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

Page 101: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016

Help keep the diversity of the web

Page 102: The web - What it has, what it lacks and where it must go - Bulgaria Web Summit, February 2016