the web - what it has, what it lacks and where it must go - istanbul

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

Upload: robert-nyman

Post on 12-Jan-2017

10.027 views

Category:

Technology


0 download

TRANSCRIPT

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

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 - Istanbul

Welcome to Turkey

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

Our line of work

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

Trends

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

My role at Google

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

My role at Google

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

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

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

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

My role at Google

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

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

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

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

The web as of today

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

The web as of today

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

The web as of today

One billion active users

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

The web as of today

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

The web as of today

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

The web as of today

Morgan Stanley: the web is winning

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

The web vs. native

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

The web vs. native

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

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

The web vs. native

10% of time on mobile spent in the browser

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

The web vs. native

10% of time on mobile spent in the browser

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

The web vs. native

?

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

The web vs. native

Facebook

One billion daily users,

where 844 million daily users are on mobile

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

The web vs. native

…and these also have more than one billion users:

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

The web vs. native

Visitor traffic to top companies/services

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

The web vs. native

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

The web vs. native

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

Tools & measures from

Google

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

App install interstitials being

non-mobile friendly

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

App install interstitials being non-mobile friendly

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

Mobile-Friendly Test

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

Mobile-Friendly Test

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

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

Communications & the web

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

Communications & the web

https://hangouts.google.com/

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

Communications & the web

WebRTC

Desktop:Microsoft EdgeGoogle ChromeMozilla FirefoxOpera 18

Android:Google ChromeMozilla FirefoxOpera Mobile

Chrome OSFirefox OS

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

Chrome DevTools

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

Chrome DevTools

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

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

Web Fundamentals

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

Web Fundamentals

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

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

Chrome Custom Tabs

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

Chrome Custom Tabs

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

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

SLICE

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

Google influencers

Paul Kinlan Jake Archibald Alex Russell Paul Lewis + many more

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

The web, moving forward

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

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

SLICE

Indexable

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

Why do developers need a native app?

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

Performance

Sensors

OS-specific features

Offline accessPeriodic background processing

Notifications

Why do developers need a native app?

From Brian Kennan

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

Performance

Sensors

OS-specific features

Offline access

Periodic background processing

Notifications

Why do developers need a native app?

From Brian Kennan

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

Initiatives to address this

New web features

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

Offline access =>

Service Workers

Service Workers

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

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

HTTPS is Needed

Service Workers

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

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

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

Service Workers

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

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

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

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

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

Updating a Service Worker

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

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

Instant Loading Web Apps with An Application Shell Architecture

Application Shell

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

Periodic background processing =>

Background Sync

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

Background Sync

Chrome Dev for Android or Chrome Canary for desktop

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

Restart the browser

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

Notifications =>

Push notifications

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

Push notifications

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

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

Push notifications

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

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

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

Push notifications

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

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

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

Add to Homescreen

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

Cache management & whitelistsApp Install Banners

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

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

All this leads to progressive

apps

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

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

Monetization

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

Future of the web

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

Future of the web

WAWKI-

Web as We Know It

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

Future of the web

Why the web?

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

Future of the web

Native platforms needs to be matched and surpassed

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

Future of the web

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

accessible across all platforms

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

Future of the web

Go simple

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

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

Future of the web

Go simple

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

workflows

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

Future of the web

Spread the word about what the web can do

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

Future of the web

Longevity of the web

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

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

Make sure to have fun!

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