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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
110
Harmony with ES6!
gnumanth
6
1.2k
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
サプライチェーン攻撃対策「層を重ねて落ちない壁」を10日間で組み上げた話 #TechLeadConf2026
kashewnuts
1
230
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
180
From Formal Specification to Property Based Test
ohbarye
0
2.4k
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
140
tRPCの概要と少しだけパフォーマンス
misoton665
2
270
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
1.6k
継続的な負荷検証を目指して
pyama86
2
900
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
220
t *testing.T は どこからやってくるの?
otakakot
1
910
🦞OpenClaw works with AWS
licux
1
340
UaaL×Androidアプリのメモリ計測 — Memory Profilerの先へ
rio432
0
130
ふにゃっとしない名前の付け方 〜哲学で茹で上げる、コシのあるソフトウェア設計〜
shimomura
0
110
Featured
See All Featured
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
33
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
70
39k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
450
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
800
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
340
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.7k
A better future with KSS
kneath
240
18k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
380
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
170
Raft: Consensus for Rubyists
vanstee
141
7.4k
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