frontend development of the (current) future

82
Frontend development of the (current) future Filip Bruun Bech-Larsen, @filipbech @IMPACTdigitaldk

Upload: filip-bruun-bech-larsen

Post on 05-Apr-2017

125 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Frontend development of the (current) future

Frontend development of the

(current) futureFilip Bruun Bech-Larsen, @filipbech

@IMPACTdigitaldk

Page 2: Frontend development of the (current) future

Filip

Page 3: Frontend development of the (current) future

#weAreHiring #Denmark

Page 4: Frontend development of the (current) future
Page 5: Frontend development of the (current) future

https://developers.google.com/experts/people/filip-bruun-bech-larsen

Page 6: Frontend development of the (current) future

https://www.facebook.com/groups/ngAarhus/

Page 7: Frontend development of the (current) future

Frontend development of the

(current) future

Page 8: Frontend development of the (current) future

So what is this talk really about?

Page 9: Frontend development of the (current) future

Progressive Web Apps

IOT

Physical Web

Payment and auth

https

http/2

Offline

Layout/styles/grid

Web APKs

EcmaScriptWeb-assembly

WebComponents

WebVRNotifications

Background sync

Page 10: Frontend development of the (current) future

Web vs Native

Page 11: Frontend development of the (current) future

Lets look at the pro’sNative• Better Performance

• Hardware access

• Offline support

• Re-engangement w. Push

Web• Only one platform

• No gate-keepers

• Fast/easy deploy/update

• the link…

Page 12: Frontend development of the (current) future

Native• Better Performance

• Hardware access

• Offline support

• Re-engangement w. Push

Web• Only one platform

• No gate-keepers

• Fast/easy deploy/update

• the link…

No long

er nat

ive on

lyLets look at the pro’s

Page 13: Frontend development of the (current) future

The web now has an answer for this

Page 14: Frontend development of the (current) future

Progressive Web Apps

Reliable, fast and engaging

https://developers.google.com/web/progressive-web-apps/

Page 15: Frontend development of the (current) future

not-a-framework™think of it more as a philosophy…

Page 16: Frontend development of the (current) future

Performance

Page 17: Frontend development of the (current) future

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

Page 18: Frontend development of the (current) future

PRPLfor structuring and serving your web-app

Page 19: Frontend development of the (current) future

Push critical resources

Render initial route

Pre-cache remaining routes

Lazy-load the resthttps://developers.google.com/web/fundamentals/performance/prpl-pattern/

Page 20: Frontend development of the (current) future

Hardware Access

Page 22: Frontend development of the (current) future

Offline and re-engagement

Page 23: Frontend development of the (current) future

ServiceWorker

https://developers.google.com/web/fundamentals/getting-started/primers/service-workers

Page 24: Frontend development of the (current) future

So what is a ServiceWorker

• its a javascript worker

• one pr. host (shared)

• lives beyond the session

• gives you a persistent programmable cache

• based on events and promises

Page 25: Frontend development of the (current) future

How do I use it• Register with a scope

• Listen and intercept events

• network-events

• push

• sync

Page 26: Frontend development of the (current) future

Show me some code for goodness

sake

Page 27: Frontend development of the (current) future

use sw-toolbox.js for caching

Page 28: Frontend development of the (current) future
Page 29: Frontend development of the (current) future
Page 30: Frontend development of the (current) future
Page 31: Frontend development of the (current) future

installableadd to homescreen

Page 32: Frontend development of the (current) future

PWAs are even better on Android

with real APKs

https://developers.google.com/web/updates/2017/02/improved-add-to-home-screen

Page 33: Frontend development of the (current) future

progressivesnake.com

source: https://github.com/filipbech/progressivesnake

Page 34: Frontend development of the (current) future

must be served over https

development can work on localhost

https://letsencrypt.org/

Page 35: Frontend development of the (current) future

HTTP/2

• Binary

• Multiplex (parallelism)

• Header compression

• Server push

https://http2.github.io/

Page 36: Frontend development of the (current) future

EcmaScriptEcmaScript is the standard, JavaScript is the

language

Page 37: Frontend development of the (current) future

ES6 (2015)• Class

• Fat arrow

• Destructuring

• Default parameters

• Rest+spread

• Symbols

• Generators

Page 38: Frontend development of the (current) future

going on…

2017:async / awaitObject.valuesObject.entries

2016:Array.prototype.includes

Exponential operator

Page 39: Frontend development of the (current) future
Page 40: Frontend development of the (current) future

PaymentRequest

Page 41: Frontend development of the (current) future
Page 42: Frontend development of the (current) future

PaymentRequest• Receive checkout info from the user

• Possible PCI-need

• Available in Chrome Android today (Firefox, edge, chrome desktop behind flag)

• Similar integration in Safari with ApplePay

• My first impressionshttps://developers.google.com/web/updates/2016/07/payment-request

Page 43: Frontend development of the (current) future
Page 44: Frontend development of the (current) future
Page 45: Frontend development of the (current) future
Page 46: Frontend development of the (current) future

Authcredential management API

Page 47: Frontend development of the (current) future

Credential Manangement API

• Store (and sync) credentials in the browser

• Use the browsers account-chooser

• automatic sign-in (no forever living cookies)

https://developers.google.com/web/updates/2016/04/credential-management-api

Page 48: Frontend development of the (current) future
Page 49: Frontend development of the (current) future
Page 50: Frontend development of the (current) future

stylecustom properties

gridhoudini

Page 51: Frontend development of the (current) future

Custom propertieslike scss variables but at runtime!

https://developer.mozilla.org/en-US/docs/Web/CSS/--*

Page 52: Frontend development of the (current) future
Page 53: Frontend development of the (current) future

Grida long missed friend is arriving in css…

Page 54: Frontend development of the (current) future
Page 55: Frontend development of the (current) future

http://gridbyexample.com/

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout

Page 56: Frontend development of the (current) future

https://www.youtube.com/playlist?list=PLQkVA6z3dFvbnBJetfYDAF3-cG_ubgdZR

Page 57: Frontend development of the (current) future

Houdinijavascript access to the underlying magic

Page 58: Frontend development of the (current) future
Page 59: Frontend development of the (current) future
Page 60: Frontend development of the (current) future
Page 61: Frontend development of the (current) future
Page 62: Frontend development of the (current) future

Internet of Thingsand that Physical web thing

Page 63: Frontend development of the (current) future
Page 64: Frontend development of the (current) future
Page 65: Frontend development of the (current) future

https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web

Page 66: Frontend development of the (current) future

The physical webEddystone beacons

https://google.github.io/physical-web/

Page 67: Frontend development of the (current) future
Page 68: Frontend development of the (current) future
Page 69: Frontend development of the (current) future
Page 70: Frontend development of the (current) future

WebComponents (v1)

native components - ‘cause everything is a component

<mini-basket></mini-basket>

Page 71: Frontend development of the (current) future

4 specs really

• Custom elements

• HTML templates

• Shadow DOM

• HTML imports

https://developers.google.com/web/fundamentals/getting-started/primers/shadowdom https://developers.google.com/web/fundamentals/getting-started/primers/customelements

Page 72: Frontend development of the (current) future

Web VR

https://webvr.info/

Page 73: Frontend development of the (current) future

works with hardware

or in browser with polyfill

* still very experimental. No real browser support

Page 74: Frontend development of the (current) future
Page 75: Frontend development of the (current) future

WebAssemblybinary execution in the browser for performance

and portability

https://developer.mozilla.org/en-US/docs/WebAssembly

Page 76: Frontend development of the (current) future

binary (small download) + fast

(real memory access)

think Photoshop, Final Cut Pro, 3D studio max, (games obciously)… in the browser

http://webassembly.org/demo/Tanks/ https://www.youtube.com/watch?v=PvZdTZ1Nl5o

Page 77: Frontend development of the (current) future

don’t think of it as a new language

it’s (first and foremost) a compiler target (from C, C++, …), that will give you speed

hint: you can use for just parts of a PWA

https://hacks.mozilla.org/2017/03/why-webassembly-is-faster-than-asm-js/

Page 78: Frontend development of the (current) future

So the platform itself is really cool

but what else is hot now…

Page 79: Frontend development of the (current) future

Trends• Types (flow, typescript)

• Code-generation

• Do the heavy lifting at build-time (Angular AOT, Svelte)

• Yarn replaces NPM (not the registry)

• Managing dataflow (redux, immutability, observables)

Page 80: Frontend development of the (current) future

The web is powerful itself

- embrace it

Page 81: Frontend development of the (current) future

@filipbech@IMPACTdigitaldk

I’ll tweet a link to the slides in a minuteThank you

Page 82: Frontend development of the (current) future