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
·
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
180
Python Intro
gnumanth
1
410
Other Decks in Programming
See All in Programming
初めての模倣学習とVLA
natsutan
0
480
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
630
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.5k
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
560
PyO3 で既存 Python 評価器を Rust core 化する ー wasm-bindgen でブラウザにも配るための設計
kdash
1
400
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
3
470
Laravelのアプリケーションをどこにデプロイするか #ツナギメオフライン.9
akase244
0
120
kubernetes コンポーネント開発入門 / 新卒N年目の勉強会&交流会!〜〇〇への誘い〜 #n_study
mazrean
0
160
バグを直したら useEffect が消えた
colorful12
3
840
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.3k
{ Android | Kotlin } Gradle Plugin in 2026
ryunen344
1
280
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
170
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Paper Plane (Part 1)
katiecoart
PRO
1
10k
The Spectacular Lies of Maps
axbom
PRO
1
970
Optimising Largest Contentful Paint
csswizardry
37
3.9k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
320
Building an army of robots
kneath
306
46k
GraphQLとの向き合い方2022年版
quramy
50
15k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
A Soul's Torment
seathinner
7
3.5k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
520
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
220
Exploring anti-patterns in Rails
aemeredith
3
490
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