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 のリアル/ Realistic Web Components
Search
aggre
November 25, 2018
Technology
8.5k
12
Share
Web Components のリアル/ Realistic Web Components
HTML5 Conference 2018 (
https://events.html5j.org/conference/2018/11/
)での資料です
aggre
November 25, 2018
More Decks by aggre
See All by aggre
The money for the openable and shareable era
aggre
0
530
エンジニアは会社に何を求めるか? / What does engineers wants the company?
aggre
0
170
The importance ofopen assets
aggre
0
110
Fully AMP pros and cons
aggre
0
230
OSS の持続的開発をトークンエコノミーで支援する / Dev Token @OSS Universe
aggre
1
410
OSS の持続的開発をトークンエコノミーで支援する / Dev Token @CryptoBowl
aggre
1
460
Mastering lit-html directive
aggre
0
470
非中央集権ウェブ / Decentralized Web
aggre
3
630
OSS の持続的開発をトークンエコノミーで支援する / Dev Token
aggre
0
550
Other Decks in Technology
See All in Technology
Claude Code / Codex / Kiro に AWS 権限を 渡すとき、何を設計すべきか
k_adachi_01
2
290
ボトムアップの改善の火を灯し続けろ!〜支援現場で学んだ、消えないための3つの打ち手〜 / 20260509 Kazuki Mori
shift_evolve
PRO
2
600
(きっとたぶん)人材育成や教育のような何かの話
sejima
0
670
いつの間にかデータエンジニア以外の業務も増えていたけど、意外と経験が役に立ってる
zozotech
PRO
0
300
サンプリングは「作る」のか「使う」のか? 分散トレースのコストと運用を両立する実践的戦略 / Why you need the tail sampling and why you don't want it
ymotongpoo
3
140
Building Production-Ready Agents Microsoft Agent Framework
_mertmetin
0
160
アプリブロック機能のつくりかたと、AIとHTMLの不合理な相性の良さについて
kumamotone
1
220
Tachikawa.any 運営挨拶
daitasu
0
130
ハーネスエンジニアリング入門
hatyibei
0
110
Swift Sequence の便利 API 再発見
treastrain
1
230
変化の激しい時代をゴキゲンに生き抜くために 〜ストレスマネジメントのススメ〜
kakehashi
PRO
4
1.2k
ボトムアップ限界を越える - 20チームを束る "Drive Map" / Beyond Bottom-Up: A 'Drive Map' for 20 Teams
kaonavi
0
170
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
41
2.4k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
110
WENDY [Excerpt]
tessaabrams
10
37k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
140
Music & Morning Musume
bryan
47
7.2k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
530
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
370
Transcript
Web Components HTML5 Conference 2018 @2018-11-25
aggre @aggre_ @aggre FRAME00, INC. CTO aggre.io
• Web Components (5min) • Web Components (5min) • Web
Components (10min) • Web Components (20min)
Web Components
Custom Elements Shadow DOM HTML Templates ES Modules
Custom Elements Shadow DOM HTML Templates ES Modules / Production-ready
Custom Elements Shadow DOM HTML Templates ES Modules Edge Developing
‼
IE
IE • Windows 10 Edge • Windows 7 2020 1
• Windows 8.1 ? Edge … App
None
Polyfills IE, Edge
Polyfills IE, Edge Shadow DOM
• / Polyfills OK • Edge , IE 2020 Polyfills
Web Components
• Custom Elements • Shadow DOM • HTML Templates •
HTML Imports
• Custom Elements • Shadow DOM • ES Modules
• Custom Elements • Shadow DOM • HTML Templates •
HTML Imports • Custom Elements • Shadow DOM • ES Modules
None
HTML
HTML
Custom Elements
Custom Elements
None
Custom Elements Shadow DOM ES Modules
Custom Elements Shadow DOM ES Modules Custom Elements Shadow DOM
DOM
Custom Elements
None
None
DOM createElement()
DOM createElement()
None
None
None
destroy
observedAttributes DOM
observedAttributes DOM
iframe adoptNode() ownerDocument
iframe adoptNode() ownerDocument
Shadow DOM
DOM
CSS
Shadow DOM
None
Shadow DOM
<slot>
<slot> Shadow DOM slot slot
None
slot
None
Shadow DOM slot
• Custom Elements • • Shadow DOM DOM • slot
Shadow DOM
Web Components
• • • • SSR • more…
Web Components
None
size=large
Web Components
e.g. <iron-autogrow-textarea>
e.g. <pinch-zoom>
Web Components xxx-dnd … <drag-and-drop>
None
Web Components
e.g. React
e.g. React Shadow DOM React render
• Web Components • React, Angular, Vue… • • •
:
SSR Shadow DOM slot Hydrate SSR
HTML
shadowRoot <slot> render shadowRoot
shadowRoot <slot> render shadowRoot slot
shadowRoot <slot> render shadowRoot Hydrate
shadowRoot <slot> render shadowRoot SSR
• Custom Elements • Shadow DOM, slot • •
Web Components
…
None
Web Components
• • lit-html • Web Components • lit-html Web Components
• lit-element • Angular/Vue
• lit-html • lit-html Web Components • lit-element • Angular/Vue
• lit-html • lit-html Web Components • lit-element • Angular/Vue
Web Components
• lit-html • lit-html Web Components • lit-element • Angular/Vue
FW FW Web Components
• lit-html • lit-html Web Components • lit-element • Angular/Vue
( )
None
• • innerHTML addEventListener DOM API •
lit-html ( lit-html )
None
lit-html
lit-html
lit-html html, render directive 3 API
lit-html Tagged Templates
lit-html HTML
lit-html HTML DOM DOM
lit-html DOM
lit-html textContent <p>
@Event
?attribute
.property DOM
Intellisense for lit-html typescript-lit-html-plugin, vscode-lit-html
lit-html • lit-html • Intellisense • Web Components • …
• lit-html • lit-element
lit-element
None
None
lit-html React.Component
lit-element • TypeScript Native • lit-html • Web Components •
@property({type: X}) • • lit-html .property
lit-html
None
None
lit-html
None
<header>
<nav>
<article>
<footer>
JSX lit-html
RxJS
fit-html Redux + lit-html
Directive API
Directive API 1
Directive API 0 -1
Directive API directive
Directive API
Directive API render
lit-html • TypeScript Native • JSX • Directive API •
• Vue/Angular HTML React
appendix
lit-html, hyperHTML, htm Tagged Templates
lit-html
hyperHTML
hyperHTML bind() DOM
hyperHTML wire()
htm
htm htm ( preact )
htm JSX
htm …
lit-html hyperHTML htm • (HTML Template Instantiation) • PolymerLabs/template-instantiation •
Directive API • ES5 • Node.js • Tagged Templates JSX • preact vhtml developit/ WebReflection/ Polymer/
( TypeScript Native lit-html )
• lit-element Web Components • FP lit-html ( )
• / Polyfills OK • Edge , IE 2020 Polyfills
• Custom Elements • Shadow DOM DOM • slot Shadow DOM • • • lit-element Web Components • FP lit-html
Thank you! @aggre_ @aggre aggre.io