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
Spec-driven Development: How AI Changes Everything (And Nothing)
simas
PRO
0
210
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
150
Claude CodeでETLジョブ実行テストを自動化してみた
yoshikikasama
0
810
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
110
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
800
tRPCの概要と少しだけパフォーマンス
misoton665
2
240
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
24
14k
Vibe NLP for Applied NLP
inesmontani
PRO
0
470
セグメントとターゲットを意識するプロポーザルの書き方 〜採択の鍵は、誰に刺すかを見極めるマーケティング戦略にある〜
m3m0r7
PRO
0
590
GoogleCloudとterraform完全に理解した
terisuke
1
160
AWSコミュニティ活動は顧客のクラウド推進に効くのか / Do AWS community activities help customers adopt the cloud?
seike460
PRO
0
150
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
230
Featured
See All Featured
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.7k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.2k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
490
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
220
How GitHub (no longer) Works
holman
316
150k
Accessibility Awareness
sabderemane
1
100
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
Making Projects Easy
brettharned
120
6.6k
Leo the Paperboy
mayatellez
7
1.7k
A better future with KSS
kneath
240
18k
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