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
ponday
February 26, 2019
Programming
480
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
More Decks by ponday
See All by ponday
関数型でGoFのデザインパターンやってみる
honda
1
1.7k
TypeScriptの型表現
honda
10
3.1k
これまでのReact、これからのReact
honda
0
350
Gatsbyお試し
honda
0
150
styled-components or emotion?
honda
0
730
Web ComponentsとAngular
honda
0
160
Atomic Design周りについての私見
honda
1
810
え、まだWeb Componentsを未来の技術だと思ってるの?
honda
2
890
Web Componentsの動向とPolymer
honda
4
2.8k
Other Decks in Programming
See All in Programming
スマート反転とウェブアクセシビリティ
camiha
0
210
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
470
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
120
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
280
Intent as Code
shoppingjaws
6
1k
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
290
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
290
アクセシビリティから考える情報設計
high_g_engineer
0
380
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
370
Heart of Swift Concurrency
koher
0
910
新卒PdEのリアル
ryu1013
1
500
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
280
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
37
4k
sira's awesome portfolio website redesign presentation
elsirapls
0
420
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
240
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
530
How to Ace a Technical Interview
jacobian
281
24k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
410
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
380
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
Navigating Team Friction
lara
192
16k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
500
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
330
Transcript
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 !!