Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Web Components v1
Search
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
130
Harmony with ES6!
gnumanth
6
1.3k
Ants and Algorithm
gnumanth
1
150
NoSQL?
gnumanth
2
270
Google's whitepaper
gnumanth
3
190
Python Intro
gnumanth
1
410
Other Decks in Programming
See All in Programming
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
110
Embedded Swiftで作る自作USBデバイス によるiOSデバイスの自動テスト / iOSDC Japan 2026 glassfiber
glassfiber
0
300
スマートフォンでモールス信号を送受信する 〜スマートフォンのLEDとカメラで作る光通信の設計と実装〜
atsuki_seo
0
230
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
310
phperだってパンチカードでコーディングしたい
o0h
PRO
0
220
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
120
Androidだけじゃない、DroidKaigiで広がった私の技術スタック
akkeylab
0
120
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.1k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
460
AWSに止められる覚悟してますか?
morizo_1984
2
510
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
150
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
340
Featured
See All Featured
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
450
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
460
Discover your Explorer Soul
emna__ayadi
2
1.3k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
530
How to build a perfect <img>
jonoalderson
1
6.1k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
570
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
Six Lessons from altMBA
skipperchong
29
4.5k
We Have a Design System, Now What?
morganepeng
55
8.4k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Skip the Path - Find Your Career Trail
mkilby
1
240
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