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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
Embedded Swiftで作る自作USBデバイス によるiOSデバイスの自動テスト / iOSDC Japan 2026 glassfiber
glassfiber
0
260
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
470
Webの地図
yosuke_furukawa
PRO
6
5k
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
130
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
140
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
6k
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
330
Simple Storage Service(S3) is not simple
iwatsukayura
0
120
FreeBSDでZabbixを動かす
kenkino
0
350
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.1k
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
130
SREの越境 / SRE Collaboration
y0hgi
2
290
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
290
Everyday Curiosity
cassininazir
0
340
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
290
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Git: the NoSQL Database
bkeepers
PRO
432
67k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
250
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