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
hemanth.hm
April 13, 2017
Programming
130
1
Share
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
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
1k
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
320
デフォルト運用のCodeRabbit、1年で何が変わったか / How CodeRabbit Changed Our Code Review in 1 Year
bake0937
1
100
AIエージェントの隔離技術の徹底比較
kawayu
0
430
実践ハーネスエンジニアリング:ステアリングループを実例から読み解く / Practical Harness Engineering: Understanding Steering Loops Through Real-World Examples
nrslib
6
6.2k
ふつうのFeature Flag実践入門
irof
0
110
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
130
CLIであることを活かしたGitHub Copilot CLI活用術 / GitHub Copilot CLI Pro Tips & Tricks
nao_mk2
1
970
サプライチェーン攻撃対策「層を重ねて落ちない壁」を10日間で組み上げた話 #TechLeadConf2026
kashewnuts
1
360
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
790
Zod v4 Codec でスキーマに型変換を埋め込む REST API 設計 #TSKaigi2026
ryutaro_yako
0
140
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
270
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
760
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.6k
sira's awesome portfolio website redesign presentation
elsirapls
0
250
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
820
Mobile First: as difficult as doing things right
swwweet
225
10k
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
290
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Designing Experiences People Love
moore
143
24k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
300
Design in an AI World
tapps
1
210
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