Frontend development
of the (current) future
Filip Bruun Bech-Larsen, @filipbech
@IMPACTdigitaldk
Filip
!
#weAreHiring #Denmark
https://developers.google.com/experts/people/filip-bruun-bech-larsen
https://www.facebook.com/groups/ngAarhus/
Frontend development
of the (current) future
So what is this talk 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
https://www.fidgetspin.xyz/
must be served
over https
development can work on localhost
https://letsencrypt.org/
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
PaymentRequest
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 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
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
What about style
custom properties
grid
houdini
Custom properties
like scss variables but at runtime, and with tree-inheritance
https://developer.mozilla.org/en-US/docs/Web/CSS/--*
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
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/
works with hardware
or in browser with polyfill
come try cardboard after
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
obciously)… 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/
So the platform itself is
really cool
but what else is hot now…
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)
The platform is powerful
- embrace it
#useThePlatform
@filipbech@IMPACTdigitaldk
I’ll tweet a link to the slides in a minute
Thank you
Frontend development of the (current) future

Frontend development of the (current) future