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
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
140
NoSQL?
gnumanth
2
270
Google's whitepaper
gnumanth
3
180
Python Intro
gnumanth
1
410
Other Decks in Programming
See All in Programming
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
210
【やさしく解説 設計編・中級 #4】ルールの寿命と、システムの年輪
panda728
PRO
2
180
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
3
1.1k
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
190
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
490
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
120
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
140
torikago - Ruby::Boxで照らすモジュラモノリスの実行境界
se4weed
1
280
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
270
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
440
テーブルをDELETEした
yuzneri
0
130
霧の中の代数的エフェクト
funnyycat
1
450
Featured
See All Featured
Test your architecture with Archunit
thirion
1
2.3k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
1k
Building Adaptive Systems
keathley
44
3.1k
WCS-LA-2024
lcolladotor
0
770
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
160
A better future with KSS
kneath
240
18k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
400
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.7k
30 Presentation Tips
portentint
PRO
1
360
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