The future of the web
Filip Bruun Bech-Larsen, @filipbech
@IMPACTdigitaldk
@filipbech
#weAreHiring #Aarhus #Cph
https://developers.google.com/experts/people/filip-bruun-bech-larsen
https://www.facebook.com/groups/ngAarhus/
The future of the web…
What is this really about?
Progressive Web Apps
IOT
Physical Web
Payment and auth
https
http/2
Offline
Layout/styles/grid
Web APKs
EcmaScript
Web-assembly
WebComponents
WebVR
Notifications
Background sync
Web vs Native
Lets look at the pro’s
Native
• Better Performance
• Hardware access
• Offline support
• Re-engangement w. Push
Web
• Only one platform
• No gate-keepers
• Fast/easy deploy/update
• the link…
The web now has an
answer for this
Progressive Web Apps
Reliable, fast and engaging
https://developers.google.com/web/progressive-web-apps/
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
longer native
only
Lets look at the pro’s
not-a-framework™
think of it more as a philosophy…
Performance
https://developers.google.com/web/fundamentals/performance/rail
PRPL
for structuring and serving your web-app
Push critical resources
Render initial route (SSR?)
Pre-cache remaining routes
Lazy-load the rest
https://developers.google.com/web/fundamentals/performance/prpl-pattern/
Hardware Access
Hardware Access
geolocation
Web-bluetooth
Generic sensor API
WebGL
orientation + motionWebAudio
Camera
(+shape-detection)
Full-screen
VR
Offline and
re-engagement
ServiceWorker
https://developers.google.com/web/fundamentals/getting-started/primers/service-workers
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
How do I use it
• Register with a scope
• Listen and intercept events
• network-events
• push
• sync
Show me some code
already…
use sw-toolbox.js for caching
installable
add to homescreen
PWAs are even better
on Android
with “web-APK”s
https://developers.google.com/web/updates/2017/02/improved-add-to-home-screen
https://developers.google.com/web/tools/lighthouse/
progressivesnake.com
source: https://github.com/filipbech/progressivesnake
progressivedice.com
source: https://github.com/filipbech/progressivedice
https://www.fidgetspin.xyz/
hnpwa.com
like todoMVC for pwa's
must be served
over https
development can work on localhost
https://letsencrypt.org/
Speaking of https
https://blog.chromium.org/2017/04/next-steps-toward-more-connection.html
HTTP/2
• Binary
• Multiplex (parallelism)
• Header compression
• Server push
https://http2.github.io/
EcmaScript
EcmaScript is the standard, JavaScript is the language
ES6 (2015)
• Class
• Fat arrow
• Destructuring
• Default parameters
• Rest+spread
• Symbols
going on…
2017:
async / await
Object.values
Object.entries
2016:

Array.prototype.includes
Exponential operator
Putting it together
PaymentRequest
PaymentRequest
• Receive checkout info from the user
• Possible PCI-need
• Available in Chrome and Edge today (Firefox behind flag,
positive feedback from Apple)
• Similar integration in Safari with ApplePay
• My first impressions
https://developers.google.com/web/updates/2016/07/payment-request
https://filipbech.github.io/demos/payment.html
https://github.com/filipbech/filipbech.github.io/blob/master/demos/payment.html
Auth
credential management API
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
https://filipbech.github.io/demos/auth.html
https://github.com/filipbech/filipbech.github.io/blob/master/demos/auth.html
WebComponents (v1)
native components - ‘cause everything is a component
<mini-basket></mini-basket>
4 specs really
• Custom elements
• HTML templates
• Shadow DOM
• HTML imports (but forget about this one… :-/)
https://developers.google.com/web/fundamentals/getting-started/primers/shadowdom
https://developers.google.com/web/fundamentals/getting-started/primers/customelements
https://twitter.com/AJStacy06/status/857628546507968512
https://youtube.googleblog.com/2017/05/a-sneak-peek-at-youtubes-new-look-and.html
Tagged Template Literals
• Not just multiline strings…
• Enables a new kind of templating system
• check out lit-html - intro (and lit-element)
Tagged Template Literals
What about style
custom properties
grid
houdini
Custom properties
like sass variables but at runtime, and with tree-inheritance
https://developer.mozilla.org/en-US/docs/Web/CSS/--*
Use custom-properties to theme your custom-element
Grid
a long missed friend is arriving in css…
http://gridbyexample.com/
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout
https://www.youtube.com/playlist?
list=PLQkVA6z3dFvbnBJetfYDAF3-cG_ubgdZR
Houdini
javascript access to the underlying magic
its basically worklets,
typed CSSOM and
custom display
Sam Richard: https://www.youtube.com/watch?v=r-Hc3hN9e6I
Surma: https://www.youtube.com/watch?v=sE3ttkP15f8
this api has changed a little - its actually attributeStyleMap now
Internet of Things
and that Physical web thing
demo time…
https://github.com/filipbech/filipbech.github.io/blob/master/demos/bluetooth-LED.html
https://filipbech.github.io/demos/bluetooth-LED.html
https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web
The physical web
Eddystone beacons
https://google.github.io/physical-web/
Web VR
https://webvr.info/
https://aframe.io/examples/showcase/shopping/
Try out cardboard
http://vr.chromeexperiments.com/
WebAssembly
binary execution in the browser for performance and portability
https://developer.mozilla.org/en-US/docs/WebAssembly
binary (small download) +
fast (real memory access)
think Photoshop, Final Cut Pro, 3D studio max, (games
obviously)… in the browser
http://webassembly.org/demo/Tanks/
https://www.youtube.com/watch?v=PvZdTZ1Nl5o
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/
The platform is powerful
- embrace it
#useThePlatform
@filipbech@IMPACTdigitaldk
I’ll tweet a link to the slides in a minute
Thank you
Future of the Web

Future of the Web