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 v1
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
hemanth.hm
April 13, 2017
Programming
140
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Web Components v1
Quick intro to Web Components v1
hemanth.hm
April 13, 2017
More Decks by hemanth.hm
See All by hemanth.hm
Rethink Async
gnumanth
1
120
Harmony with ES6!
gnumanth
6
1.3k
Ants and Algorithm
gnumanth
1
140
NoSQL?
gnumanth
2
260
Google's whitepaper
gnumanth
3
170
Python Intro
gnumanth
1
400
Other Decks in Programming
See All in Programming
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
240
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.6k
LLM Plugin for Node-REDの利用方法と開発について
404background
0
170
RTSPクライアントを自作してみた話
simotin13
0
580
Contextとはなにか
chiroruxx
1
290
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
160
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
12
3.6k
Inside Stream API
skrb
1
690
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.4k
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
540
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
190
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
3
1.3k
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
432
67k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
The Pragmatic Product Professional
lauravandoore
37
7.3k
Accessibility Awareness
sabderemane
1
140
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.6k
Ruling the World: When Life Gets Gamed
codingconduct
0
250
For a Future-Friendly Web
brad_frost
183
10k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
What's in a price? How to price your products and services
michaelherold
247
13k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Transcript
Web Componentes
· <template> tag · HTML imports · Shadow DOM ·
Custom Elements
<template>
'content' in document.createElement('template');
Activating <template>: var t = document.querySelector('#aweTemplate'); var clone = document.importNode(t.content,
true); document.body.appendChild(clone);
DEMO
HTML imports
'import' in document.createElement('link');
<link rel="import" href="/imports/aweTemplate.html"> <link rel="import" href="/imports/aweTemplate.html" onload="handleLoad(event)" onerror="handleError(event)">
const link = document.querySelector('link[rel=import]'); const xkcd = link.import; // Access
DOM of the document in aweTemplate const cartoon = xkcd.querySelector('img');
const aweDoc = document.currentScript.ownerDocument;
DEMO
Shadow DOM
const supportsShadowDOMV1 = !!HTMLElement.prototype.attachShadow;
const host = document.body.createShadowRoot(); host.innerHTML = "<p>I'm a <em>shadow</em> dom!</p>";
document.appendChild(host);
DEMO
Custom Elements
const supportsCustomElements = 'customElements' in window;
class AweElement extends HTMLElement {...} window.customElements.define('awe-element', AppDrawer);
window.customElements.define('awe-element', class extends HTMLElement {...});
class AweElement extends HTMLElement { constructor() { super(); // Don't
forget ... } connectedCallback() { ... } disconnectedCallback() { ... } attributeChangedCallback(attrName, oldVal, newVal) { ... } }
None
DEMO
None
None
h3manth.com @gnumanth
None