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の今
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
ponday
February 26, 2019
Programming
490
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Web Componentsの今
FukuokaJS『三大フレームワーク + WebComponents』(2019/02/26)の発表資料です。
ponday
February 26, 2019
Transcript
29 slides
Web Componentsの今 FukuokaJS『三大フレームワーク + WebComponents』 / Feb 26th, 2019 ponday
(@ponday_dev)
Profile - ponday (Honda, Yusuke) - 株式会社ベガコーポレーション - Like :
TypeScript / Elixir / Python etc… - 副業もやってます
ここの話
今日の内容 - Web Componentsとは? - Web Componentsの良いところ/つらいところ - Web Components向けのライブラリ
- JSフレームワークとWeb Components
Web Components
Web Components - Web標準の技術で、再利用可能な部品を作るAPI - いくつかの仕様の総称 - Custom Elements -
Shadow DOM - ES Modules - すでにEdge以外のブラウザで対応済!
Custom Elements - 独自のHTML要素を定義できるAPI - customElements.define - class構文を使う - いわゆるコンポーネント機能
None
Shadow DOM - グローバルから独立したDOMツリー - CSSやJSの影響範囲が限定できる - Scoped CSSなどが実現できる -
Shadow DOMの中のCSSは外部に影響を与えない - Shadow DOMの中のCSSは外部の影響を受けない
None
これまで Component Component Component State Management Routing State Management Routing
State Management Routing DOM API
これまでのWeb開発 - コンポーネント機構は各フレームワークが提供 - DOM APIにはコンポーネント機構がない - 各フレームワークが頑張ってコンポーネントを実現していた - Scoped
CSSなどのカプセル化の仕組みも同様 - フレームワークに依存するコンポーネント - 当然、フレームワーク間の互換性はない - UIライブラリはフレームワークごとに必要
これから DOM API Component Component Component State Management Routing State
Management Routing State Management Routing Web Components
これからのWeb開発 - DOM APIもコンポーネント機構を持つ - カプセル化の仕組みも備える - コンポーネント機構の新しい選択肢 - 特定の技術に依存しないコンポーネント
- フレームワークなどに依存しない - 真の意味で汎用的な部品の実現
Web Componentsの良いところ - Web標準の技術であること - ブラウザネイティブなサポート - 複雑なビルド設定は不要 - 他のフレームワークとの共存も簡単
- 導入が非常に簡単 - Web標準の技術だからこそ - 外部からの影響を受けない/外部に影響を与えない
つらいところ - 長くなりがち - ボイラープレートが多い - 描画タイミングの管理 - テンプレートが書きづらい -
文字列 or DOM API - 当然、差分更新はない
lit-html / LitElement
lit-html - テンプレート構築用のライブラリ - Tagged Template Literalsベース - テンプレートが関数になるので取り回しやすい -
Web Components以外の用途でも使える - 最近バージョン1.0が出た
None
LitElement - Web Componentsをシンプルに書くためのライブラリ - Polymerの後継 - 素のWeb Componentsを書くのは結構つらい -
面倒な部分をラップしてよしなに処理してくれる - テンプレートエンジンとしてlit-htmlを利用 - 最近バージョン2.0が出た
None
DEMO
DEMO - imgタグの改良版 - lazy loading/中断 - 拡大表示
Q. JSフレームワークは不要になるの?
なりません
JSフレームワークとの関わり - Web Components単体でアプリは作れない - 状態管理やルーティングの面倒はみない - JSフレームワークとは競合ではなく、共存するもの - 一部のコンポーネントがWeb
Componentsで置き換えられる - 状態管理やルーティングは、フレームワークの責務 - フレームワーク → Web Componentsへの変換も
Web Componentsの使いどころ - 汎用的なコンポーネント - Atomic Designにおける〜Moleculesくらいがターゲット - UIライブラリが担っている領域 -
既存資産の活用 - JSフレームワーク製のコンポーネントをWeb Components化 - 別のシステム、JSフレームワークに流用できる
まとめ - Web Componentsは再利用可能な部品を作るAPI - 対応ブラウザも増えてきている - JSフレームワークとは競合ではなく共存するもの
Thank you !!
More Decks by ponday
See All by ponday
関数型でGoFのデザインパターンやってみる
honda
1
1.7k
TypeScriptの型表現
honda
10
3.2k
これまでのReact、これからのReact
honda
0
350
Gatsbyお試し
honda
0
150
styled-components or emotion?
honda
0
730
Web ComponentsとAngular
honda
0
170
Atomic Design周りについての私見
honda
1
830
え、まだWeb Componentsを未来の技術だと思ってるの?
honda
2
900
Web Componentsの動向とPolymer
honda
4
2.8k
Other Decks in Programming
See All in Programming
AI駆動TDD ― 2026年10月版
hrmstrsmgs
0
110
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
6.3k
[Kotlin Fest 2026] eBPF Tracing for Kotlin
takehaya
1
400
Spec-driven Development with AI
simas
PRO
0
2.3k
仕様駆動開発入門 (何を作るかを先に決めて渡す) | 目指せ Kiro マスター 05
inariku
PRO
3
220
自宅サーバはどこまで再現できるのか - Proxmox VE上のVM環境をIaCとバックアップで戻してみた
youto
0
450
Beyond Chatbots: Agentic UI with Open Standards @W-JAX 2026, München
manfredsteyer
PRO
0
130
Going Full Circle with Virtual Graphs and Relational Databases
michaelsimons
1
110
Kotlin Fest 2026: Kotlin コンパイラに Contribute してみよう! - Kotlin/Wasm で深い再帰を書けるようにした話
ternbusty
1
420
はじめてのPLATEAU
nokonoko1203
1
670
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
270
How SRE Grew Out of Server-Side Work and Became the Team's Own / サーバサイドから始まったSREを チームに渡すまで
maaaato
0
200
Featured
See All Featured
Abbi's Birthday
coloredviolet
5
11k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Optimizing for Happiness
mojombo
378
72k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
760
Bash Introduction
62gerente
615
220k
The Art of Programming - Codeland 2020
erikaheidi
57
15k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
400
A designer walks into a library…
pauljervisheath
211
25k
Highjacked: Video Game Concept Design
rkendrick25
PRO
2
590
Designing Experiences People Love
moore
143
24k
Un-Boring Meetings
codingconduct
0
510
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
380