Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Web Components: Where we are now, and what’s next?
Search
Peter Gasston
June 19, 2015
Technology
1
180
Web Components: Where we are now, and what’s next?
Responsive Day Out, 19/06/15.
Peter Gasston
June 19, 2015
Tweet
Share
More Decks by Peter Gasston
See All by Peter Gasston
People Don’t Change
stopsatgreen
0
130
Your Reality Here
stopsatgreen
0
76
Growing Up, Getting Serious - #SotB6
stopsatgreen
1
310
Growing Up, Getting Serious
stopsatgreen
0
66
Surveying the Landscape — November 2016
stopsatgreen
1
130
Surveying the Landscape - Fronteers
stopsatgreen
2
440
The Web vs. The Browser
stopsatgreen
0
150
Surveying the Landscape Sept. 2016
stopsatgreen
1
260
Surveying the Landscape
stopsatgreen
4
720
Other Decks in Technology
See All in Technology
サービスでLLMを採用したばっかりに振り回され続けたこの一年のあれやこれや
segavvy
2
370
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
320
サイバー攻撃を想定したセキュリティガイドライン 策定とASM及びCNAPPの活用方法
syoshie
3
1.2k
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
2
260
AIのコンプラは何故しんどい?
shujisado
1
190
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
170
継続的にアウトカムを生み出し ビジネスにつなげる、 戦略と運営に対するタイミーのQUEST(探求)
zigorou
0
510
バクラクのドキュメント解析技術と実データにおける課題 / layerx-ccc-winter-2024
shimacos
2
1k
NilAway による静的解析で「10 億ドル」を節約する #kyotogo / Kyoto Go 56th
ytaka23
3
370
株式会社ログラス − エンジニア向け会社説明資料 / Loglass Comapany Deck for Engineer
loglass2019
3
31k
NW-JAWS #14 re:Invent 2024(予選落ち含)で 発表された推しアップデートについて
nagisa53
0
250
PHPからGoへのマイグレーション for DMMアフィリエイト
yabakokobayashi
1
160
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
How to Ace a Technical Interview
jacobian
276
23k
Facilitating Awesome Meetings
lara
50
6.1k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Embracing the Ebb and Flow
colly
84
4.5k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Become a Pro
speakerdeck
PRO
26
5k
Practical Orchestrator
shlominoach
186
10k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Transcript
@stopsatgreen Web Components: where we are now, and what next?
Responsive Day Out 19/06/15
@stopsatgreen Peter Gasston @stopsatgreen broken-links.com
@stopsatgreen For the designers.
@stopsatgreen Web Components have been around for a while.
@stopsatgreen In a trough on the hype cycle.
@stopsatgreen Everybody’s in… but that means trouble.
@stopsatgreen Web Components enable us to create widgets. CSS JS
Widget Widget Widget
@stopsatgreen Composable, reusable, encapsulated. CSS JS Widget Widget Widget
@stopsatgreen We run things, things don’t run we, don’t take
nothing from nobody.
@stopsatgreen React, BEM, etc. are ways of doing this using
the technologies of today.
@stopsatgreen The Extensible Web Manifesto. extensiblewebmanifesto.org <picture> <source srcset="foo.png" media="(min-width:
600px)"> <img src="bar.png" alt="Logo"> </picture>
@stopsatgreen Web Components are: Templates, HTML Imports, Custom Elements, Shadow
DOM.
@stopsatgreen Templates. Reusable fragments of inert HTML.
@stopsatgreen <script type="text/x-tmpl-mustache"> … </script> <template>…</template>
@stopsatgreen Templates. OK to use, with fallback for IE/Edge.
@stopsatgreen HTML Imports. Include HTML documents in an HTML document.
@stopsatgreen <link rel="import" href="file.html"> // file.js export foo; // page.js
import foo from "file.js";
@stopsatgreen HTML Imports. Will probably be replaced by ES6 modules.
@stopsatgreen Shadow DOM. Hide complex markup inside an element.
@stopsatgreen root = el.createShadowRoot({ mode: 'open' }); root.innerHTML = '<div>…</div>';
@stopsatgreen Shadow DOM is very hard to polyfill.
@stopsatgreen Shadow DOM. Lots still to be defined.
@stopsatgreen Custom Elements. Meaningful markup with bespoke properties.
@stopsatgreen <fun-times></fun-times> document.registerElement('fun-times');
@stopsatgreen <fun-times> = HTMLElement <funtimes> = HTMLUnknownElement document.registerElement('fun-times'); <fun-times> =
fun-times
@stopsatgreen fTs = document.querySelector('fun-times'); fTs.hooray(); p = Object.create(HTMLElement.prototype); p.hooray =
function() {…}; document.registerElement('fun-times', { prototype: p });
@stopsatgreen // ES6 approach (not final) class fTs extends HTMLElement
{…} document.registerElement('fun-times', fTs); ES6 offers a better way to do this.
@stopsatgreen Custom Elements. Approach is sound, some details to finalise.
@stopsatgreen is A major sticking point.
@stopsatgreen p = Object.create(HTMLButtonElement.prototype); document.registerElement('fun-times', { prototype: p, extends: 'button'
}); <button is="fun-times"></button>
@stopsatgreen is isn’t (probably)
@stopsatgreen In summary: welcome to the trough of disillusionment.
@stopsatgreen A tour of the sausage factory.
@stopsatgreen This is our big opportunity. We need to get
this right.
@stopsatgreen A11y, usability, SEO, etc, become our responsibility.
@stopsatgreen Sturgeon’s Revelation: 90% of everything is crap.
@stopsatgreen The Gold Standard. github.com/webcomponents/gold-standard/wiki
@stopsatgreen Loading, DOM Presence, Content, Interaction, API, Styling, Performance, Localisation,
Factoring, Development.
@stopsatgreen Unix philosophy: every component does one job.
@stopsatgreen Learn a library first, then vanilla.
@stopsatgreen
@stopsatgreen Everybody’s in. but that means trouble. …
@stopsatgreen Cheers.
@stopsatgreen Reading list: • webcomponents.org/articles/why-web-components/ • hacks.mozilla.org/2015/06/the-state-of-web-components/ • aerotwist.com/blog/polymer-for-the-performance-obsessed/ •
tjvantoll.com/speaking/slides/Web-Components-Catch/San-Francisco/ web-components-catch.pdf • w3.org/2015/04/24-webapps-minutes.html • … and many, many more.