your future html: the evolution of site design with web components

96
<your-future-html> The Evolution of Site Design with Web Components Ken Tabor, @KenTabor

Upload: ken-tabor

Post on 06-Jan-2017

33.551 views

Category:

Engineering


1 download

TRANSCRIPT

Page 1: Your Future HTML: The Evolution of Site Design with Web Components

<your-future-html>The Evolution of Site Design

with Web Components

Ken Tabor, @KenTabor

Page 2: Your Future HTML: The Evolution of Site Design with Web Components

Ken Tabor, @KenTabor

bit.ly/KenBigDesign2015

Page 3: Your Future HTML: The Evolution of Site Design with Web Components

What’s a Web Component?

Page 4: Your Future HTML: The Evolution of Site Design with Web Components

Presentation + Behavior

Page 5: Your Future HTML: The Evolution of Site Design with Web Components

Not One Off

Page 6: Your Future HTML: The Evolution of Site Design with Web Components

Drop In

Page 7: Your Future HTML: The Evolution of Site Design with Web Components

Code Solutions are investments in your

business

Page 8: Your Future HTML: The Evolution of Site Design with Web Components

Encapsulation High Cohesion Loose Coupling

Single Responsibility Interface API Composition #coderlife

Page 9: Your Future HTML: The Evolution of Site Design with Web Components

In other words

Page 10: Your Future HTML: The Evolution of Site Design with Web Components

You get to make your own HTML tags

Page 11: Your Future HTML: The Evolution of Site Design with Web Components

Polymer helps make web components now

Page 12: Your Future HTML: The Evolution of Site Design with Web Components

Google Built

Page 13: Your Future HTML: The Evolution of Site Design with Web Components

Not a framework, but a library

Page 14: Your Future HTML: The Evolution of Site Design with Web Components

Interoperates (plays nicely with others)

Page 15: Your Future HTML: The Evolution of Site Design with Web Components
Page 16: Your Future HTML: The Evolution of Site Design with Web Components

v0.5 “R&D” v0.8 “Alpha” v1.0 “Prod” v1.1 “Prod”

Ken Discovers PolymerJul 2014 March 2015 May 2015 August 2015

Page 17: Your Future HTML: The Evolution of Site Design with Web Components

Polymer is a polyfill emulating Web

Components on all modern browsers

Page 18: Your Future HTML: The Evolution of Site Design with Web Components

It’s also a “sweetened” opinion on top …

aka Syntactic Sugar

Page 19: Your Future HTML: The Evolution of Site Design with Web Components

Kinda like jQuery sits on top of plain JavaScript

DOM access

Page 20: Your Future HTML: The Evolution of Site Design with Web Components

$('#btn-accept'); vs

document.querySelector( '#btn-accept');

Page 21: Your Future HTML: The Evolution of Site Design with Web Components

Syntactic Sugar is developer friendly …

Page 22: Your Future HTML: The Evolution of Site Design with Web Components

Automatic node finding Component lifecycle

Two-way data binding Utility functions

Page 23: Your Future HTML: The Evolution of Site Design with Web Components

… but we can’t really know what’s going on under the

hood with sugar

Page 24: Your Future HTML: The Evolution of Site Design with Web Components

It’s Demo Time {{cool-button R&D}}

Page 25: Your Future HTML: The Evolution of Site Design with Web Components

github.com/KDawg/YourFutureHTML

Page 26: Your Future HTML: The Evolution of Site Design with Web Components

<cool-button id=“btn-accept" size="large" bodyColor="alazarian" quantity="42" product="Life, the Universe, and Everything" label="Press Me!"> </cool-button>

Page 27: Your Future HTML: The Evolution of Site Design with Web Components
Page 28: Your Future HTML: The Evolution of Site Design with Web Components

What’s a Web Component?

Page 29: Your Future HTML: The Evolution of Site Design with Web Components

W3C Standard

Page 30: Your Future HTML: The Evolution of Site Design with Web Components

“Almost”

Page 31: Your Future HTML: The Evolution of Site Design with Web Components
Page 32: Your Future HTML: The Evolution of Site Design with Web Components

What’s a Web Component?

Page 33: Your Future HTML: The Evolution of Site Design with Web Components

It’s an emerging standard consisting of 4 standards

Page 34: Your Future HTML: The Evolution of Site Design with Web Components

Custom Elements

Page 35: Your Future HTML: The Evolution of Site Design with Web Components

Custom Elements HTML Imports

Page 36: Your Future HTML: The Evolution of Site Design with Web Components

Custom Elements HTML Imports Shadow DOM

Page 37: Your Future HTML: The Evolution of Site Design with Web Components

Custom Elements HTML Imports Shadow DOM

Templates

Page 38: Your Future HTML: The Evolution of Site Design with Web Components

Custom Elements HTML Imports Shadow DOM

Templates

Web Component

Page 39: Your Future HTML: The Evolution of Site Design with Web Components

We need something like this for our sanity

Page 40: Your Future HTML: The Evolution of Site Design with Web Components

DOM => Document Object Model

Page 41: Your Future HTML: The Evolution of Site Design with Web Components

HTML => HyperText Markup Language

Page 42: Your Future HTML: The Evolution of Site Design with Web Components

CSS => Cascading Style Sheet

Page 43: Your Future HTML: The Evolution of Site Design with Web Components

What is this describing?

Page 44: Your Future HTML: The Evolution of Site Design with Web Components

An Essay? 😰

Page 45: Your Future HTML: The Evolution of Site Design with Web Components

Yet, we’re building highly interactive, continuously

delivered apps, across multiple operating systems,

and hardware platforms

Page 46: Your Future HTML: The Evolution of Site Design with Web Components

BLARG! 😱

Page 47: Your Future HTML: The Evolution of Site Design with Web Components

This isn’t getting any easier

Page 48: Your Future HTML: The Evolution of Site Design with Web Components

Around 2011 we started using HTML5 tags

www.google.com/trends/explore#q=html5

Page 49: Your Future HTML: The Evolution of Site Design with Web Components

Oct 28, 2014 the proposal was recommended (done)

en.wikipedia.org/wiki/HTML5

Page 50: Your Future HTML: The Evolution of Site Design with Web Components

<nav> <footer> <video> <canvas> <section>

Page 51: Your Future HTML: The Evolution of Site Design with Web Components

<div class=“wtf” id=“hth”/>

Page 52: Your Future HTML: The Evolution of Site Design with Web Components

Is HTML done?

Page 53: Your Future HTML: The Evolution of Site Design with Web Components

Am I done with HTML?

Page 54: Your Future HTML: The Evolution of Site Design with Web Components

Will we finally rid ourselves of the noisy multitude of

JavaScript MVC frameworks that plague our

decision making?

Page 55: Your Future HTML: The Evolution of Site Design with Web Components

Prototype Dojo Toolkit

YUI Ext

Angular Knockout Backbone

Ember React

2005 2005 2006 2007 2009 2010 2010 2011 2013

Source: https://en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks

Page 56: Your Future HTML: The Evolution of Site Design with Web Components

Will we finally rid ourselves of the noisy multitude of

JavaScript MVC frameworks that plague our decision making??

Page 57: Your Future HTML: The Evolution of Site Design with Web Components

Maybe

Page 58: Your Future HTML: The Evolution of Site Design with Web Components

I choose to believe in the future of Web Components

Page 59: Your Future HTML: The Evolution of Site Design with Web Components

It’s Demo Time {{tv-listing R&D}}

Page 60: Your Future HTML: The Evolution of Site Design with Web Components

github.com/KDawg/YourFutureHTML

Page 61: Your Future HTML: The Evolution of Site Design with Web Components

<tv-listing id="the-list"></tv-listing>

Page 62: Your Future HTML: The Evolution of Site Design with Web Components
Page 63: Your Future HTML: The Evolution of Site Design with Web Components

What’s up with this guy? Who is Ken Tabor?

Page 64: Your Future HTML: The Evolution of Site Design with Web Components

I’m a product engineer at Sabre building TripCase

Page 65: Your Future HTML: The Evolution of Site Design with Web Components
Page 66: Your Future HTML: The Evolution of Site Design with Web Components

What’s a Web Component?

Page 67: Your Future HTML: The Evolution of Site Design with Web Components

It’s an entry into your world

Page 68: Your Future HTML: The Evolution of Site Design with Web Components

APIs

Page 69: Your Future HTML: The Evolution of Site Design with Web Components

Design Aesthetic

Page 70: Your Future HTML: The Evolution of Site Design with Web Components

Datasets

Page 71: Your Future HTML: The Evolution of Site Design with Web Components

Why jQuery?

Page 72: Your Future HTML: The Evolution of Site Design with Web Components

jQuery because? DOM element selection

$('thing') $('#thing') $('.thing')

Page 73: Your Future HTML: The Evolution of Site Design with Web Components

But JavaScript! getElementsByTagName()

getElementById() getElementsByClassName()

querySelector()

Page 74: Your Future HTML: The Evolution of Site Design with Web Components

jQuery because? It makes AJAX easy

$.ajax()

Page 75: Your Future HTML: The Evolution of Site Design with Web Components

But JavaScript! XMLHttpRequest()

Page 76: Your Future HTML: The Evolution of Site Design with Web Components

jQuery Because? Widget plugin standard

Page 77: Your Future HTML: The Evolution of Site Design with Web Components

But Web Components!

Page 78: Your Future HTML: The Evolution of Site Design with Web Components

Why jQuery? YouMightNotNeedJQuery.com!

Page 79: Your Future HTML: The Evolution of Site Design with Web Components

Considerations

Page 80: Your Future HTML: The Evolution of Site Design with Web Components

jQuery

It’s feeling obsolete, does it help your future?

Page 81: Your Future HTML: The Evolution of Site Design with Web Components

ReactJS

Overlapping goals with Web Components, but it’s

not a standard

Page 82: Your Future HTML: The Evolution of Site Design with Web Components

IE7/IE8/IE9

Ancient tech and doesn’t support Polymer or Web

Components (or anything good in life)

Page 83: Your Future HTML: The Evolution of Site Design with Web Components

Polymer

It delivers Web Components, but it’s also

an opinionated layer

Page 84: Your Future HTML: The Evolution of Site Design with Web Components

@polymer @rob_dodson

@ebidel

polymer-project.org webcomponents.org

x-tags.org customelements.io

Learn More

@addyosmani @wilsonpage

@Web_Components

Page 85: Your Future HTML: The Evolution of Site Design with Web Components

Browser Platform Updates chromestatus.com/features

status.modern.ie webkit.org/status.html

Page 86: Your Future HTML: The Evolution of Site Design with Web Components

Web Components enable the reality of a common visual design language

that’s alive

Page 87: Your Future HTML: The Evolution of Site Design with Web Components

Drop In UI

Page 88: Your Future HTML: The Evolution of Site Design with Web Components

Share your answers: with yourself, your team, your

company, your community

Page 89: Your Future HTML: The Evolution of Site Design with Web Components

Establish an internal open source project collecting all

of your UI widgets

Page 90: Your Future HTML: The Evolution of Site Design with Web Components

Crowd-source your way to the awesome

Page 91: Your Future HTML: The Evolution of Site Design with Web Components

Features Bug fixes

Optimizations

Page 92: Your Future HTML: The Evolution of Site Design with Web Components

You don’t need Web Components to do this -

have success now

Page 93: Your Future HTML: The Evolution of Site Design with Web Components

Build the UI so you can get to the UX

Page 94: Your Future HTML: The Evolution of Site Design with Web Components

Learn Solve Interesting Problems

Share

#innovation #JFDI

Page 95: Your Future HTML: The Evolution of Site Design with Web Components

It’s Your Turn to Respond

Page 96: Your Future HTML: The Evolution of Site Design with Web Components

Look for my book

bit.ly/KenBigDesign2015

@KenTaborblog.katworksgames.com