Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Web Components v1
Search
hemanth.hm
April 13, 2017
Programming
1
120
Web Components v1
Quick intro to Web Components v1
hemanth.hm
April 13, 2017
Tweet
Share
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
130
NoSQL?
gnumanth
2
260
Google's whitepaper
gnumanth
3
150
Python Intro
gnumanth
1
390
Other Decks in Programming
See All in Programming
CSC509 Lecture 14
javiergs
PRO
0
220
TypeScript 5.9 で使えるようになった import defer でパフォーマンス最適化を実現する
bicstone
1
1k
社内オペレーション改善のためのTypeScript / TSKaigi Hokuriku 2025
dachi023
1
490
CSC305 Lecture 15
javiergs
PRO
0
250
Evolving NEWT’s TypeScript Backend for the AI-Driven Era
xpromx
0
270
[堅牢.py #1] テストを書かない研究者に送る、最初にテストを書く実験コード入門 / Let's start your ML project by writing tests
shunk031
11
6.9k
dnx で実行できるコマンド、作ってみました
tomohisa
0
140
Level up your Gemini CLI - D&D Style!
palladius
1
170
AIと協働し、イベントソーシングとアクターモデルで作る後悔しないアーキテクチャ Regret-Free Architecture with AI, Event Sourcing, and Actors
tomohisa
5
18k
これだけで丸わかり!LangChain v1.0 アップデートまとめ
os1ma
6
1.3k
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
19
12k
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
220
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Facilitating Awesome Meetings
lara
57
6.7k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
How STYLIGHT went responsive
nonsquared
100
5.9k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.4k
Designing for Performance
lara
610
69k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
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