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
Vue Fes Japan
Search
takanorip
November 03, 2018
Programming
5
10k
Vue Fes Japan
takanorip
November 03, 2018
Tweet
Share
More Decks by takanorip
See All by takanorip
Eleventy3.0 で始める爆速個人ブログ開発!
takanorip
0
110
Webフォント選定の極意!フォントの基本から最新トレンドまで徹底解説
takanorip
5
820
効果的な管理画面を デザインをするために 避けるべき5つの罠
takanorip
14
7k
社内管理画面のデザインもプロダクトデザイン
takanorip
4
1.9k
早わかり W3C Community Group
takanorip
0
470
Ubieとアクセシビリティのこれからを考える
takanorip
0
440
2023年版 デザインシステム 技術選定の勘所 - フロントエンドカンファレンス沖縄
takanorip
2
3.8k
Astroで始める爆速個人サイト開発
takanorip
15
11k
後悔しないデザインシステムの始め方
takanorip
4
3.2k
Other Decks in Programming
See All in Programming
AI Coding Agent Enablement - エージェントを自走させよう
yukukotani
14
6.1k
Lambda(Python)の リファクタリングが好きなんです
komakichi
3
190
Building a macOS screen saver with Kotlin (Android Makers 2025)
zsmb
1
150
サービスレベルを管理してアジャイルを加速しよう!! / slm-accelerate-agility
tomoyakitaura
1
180
MCP調べてみました! / Exploring MCP
uhzz
2
2.3k
Ruby's Line Breaks
yui_knk
2
930
Java 24まとめ / Java 24 summary
kishida
3
500
リアルタイムレイトレーシング + ニューラルレンダリング簡単紹介 / Real-Time Ray Tracing & Neural Rendering: A Quick Introduction (2025)
shocker_0x15
1
300
Agentic Applications with Symfony
el_stoffel
2
300
Fiber Scheduler vs. General-Purpose Parallel Client
hayaokimura
1
100
Compose Hot Reload is here, stop re-launching your apps! (Android Makers 2025)
zsmb
1
500
Being an ethical software engineer
xgouchet
PRO
0
210
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
42
7.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.6k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
30k
We Have a Design System, Now What?
morganepeng
52
7.5k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Designing for Performance
lara
608
69k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.2k
How to Ace a Technical Interview
jacobian
276
23k
Code Reviewing Like a Champion
maltzj
522
40k
GitHub's CSS Performance
jonrohan
1030
460k
Transcript
The Good relation between Vue.js and Web Components To the
future Takanori Oki @Vue Fes Japan
Self Introduction • Takanori Oki (@takanorip) • Frontend Developer at
FOLIO Inc. • Use Nuxt.js/Vue.js, React, Polymer • A member of Polymer Japan • I love font and webfont
None
What are Web Components?
Web Components w 8FCඪ४ٕज़ͰɺΧϓηϧԽ͞Εͨ ίϯϙʔωϯτʢ෦ʣͷ࠶ར༻ΛՄೳʹ ͢Δ֓೦ w 8FCඪ४ٕज़ͳͷͰɺಛఆͷπʔϧ ϥΠϒϥϦʹґଘ͠ͳ͍ w
ͦͷ··ϒϥβͰಈ࡞͢Δ
Browser Support
production-ready!
We don't need to use polyfill library!!!! (except for IE
and Edge)
Specifications • Custom Elements • Shadow DOM • HTML Template
• ES ModulesʢHTML Importsʣ HTML Modules
Custom Elements w ಠࣗͷػೳݟͨΛ࣋ͬͨ)5.-ཁૉΛ ఆٛͰ͖ΔΑ͏ʹ͢ΔͨΊͷ༷ w ఆٛͨ͠)5.-ཁૉͷλάΛ)5.-தʹ هड़ͯ͠༻͢Δ w ͜ΕҎ߱ʮಠࣗͷػೳݟͨΛ࣋ͬͨ)5.-
ཁૉʯͷ͜ͱΛʮΧελϜཁૉʯͱݺͿ
None
None
Shadow DOM w %0.ͷΧϓηϧԽΛ࣮ݱ͢ΔͨΊͷ༷ w 4IBEPX3PPUԼʹ4IBEPX5SFFͱ ݺΕΔ/PEF5SFF͕ੜ͞ΕΔ w άϩʔόϧͷ$44+BWB4DSJQU 4IBEPX%0.෦ʹӨڹ͠ͳ͍
None
None
HTML Template w <templates>ཁૉΛ༻͠)5.-υΩϡϝϯτ Ͱ)5.-ͷܗΛѻ͏ͨΊͷ༷ w ͜Ε8)"58(%0.4UBOEBSEͷҰ෦ʹ औΓࠐ·Ε͍ͯΔ w +BWB4DSJQU͔Βѻ͍͘͢͢ΔͨΊͷػೳ
֦ு͕ٞਐΜͰ͍Δ
None
ES Modules w &4Ͱಋೖ͞Εͨ&4.PEVMFTͷػೳΛ ར༻ͯ͠ɺ֎෦Ͱఆٛ͞ΕͨΧελϜཁૉΛ ಡΈࠐΉ w ͦͷલʹ)5.-*NQPSUTͱ͍͏༷͕ ଘࡏ͍͕ͯͨ͠ɺഇࢭ͞Εͨ w
HTML Modulesͱ͍͏༷͕ٞ͞Ε͍ͯΔ
HTML Imports w )5.-Λ)5.-ͰಡΈࠐΉͨΊͷ༷ w ࣅͨػೳΛ࣋ͭ&4.PEVMFTͷ༷͕҆ఆ͠ ϒϥβ࣮͕ग़ଗͬͨ͜ͱͰɺ ඇਪʹͳͬͨ w ݱࡏ།Ұ࣮͞Ε͍ͯΔ(PPHMF$ISPNF
͔Βय़ʹআ͞ΕΔ༧ఆ
HTML Modules w )5.-Λ+BWB4DSJQUͷதʹ*NQPSUՄೳ ʹ͢Δ༷ w 8FCQBDLͷIUNMMPBEFSʹࣅͨػೳΛ ϒϥβͰαϙʔτ͠Α͏ͱ͍͏ͷ w ·ͩ(JU)VCͷ*TTVFͰٞ͞Ε͍ͯΔஈ֊
ʢ$44.PEVMFTಉ࣌ʹٞ͞Ε͍ͯΔʣ
How to use Web Components with Vue.js?
None
None
How to build Web Components with Vue.js?
Vue CLI 3 Build Targets w 7VF$-*ͰCVJME͢Δͱ͖ɺ--target wcͱ ͍͏ΦϓγϣϯΛ͚ͭΔͱɺ7VFKTͷ ίϯϙʔωϯτΛ8FC$PNQPOFOUTʹ
มͯ͠CVJME͢Δ͜ͱ͕Ͱ͖Δ w ͜ΕͰੜ͞ΕͨϑΝΠϧɺ୯ମͰ 8FC$PNQPOFOUTͱͯ͠ಈ࡞͢Δ
None
None
@vue/web-component-wrapper w 7VFίϯϙʔωϯτΛϥοϓͯ͠ ΧελϜཁૉͱͯ͠ొ͢Δ w #VJME5BSHFUTͰ͜ΕΛ༻͍ͯ͠Δ w 7VFKTΛϥοϓ͍ͯ͠ΔͷͰɺ ௨ৗͷ8FC$PNQPOFOUTͱൺͯ ϑΝΠϧαΠζ͕େ͖͍
None
͜ͷػೳΛ͏͜ͱͰ Vue.jsͷίϯϙʔωϯτΛ Web Components εϜʔζʹҠߦͰ͖Δ
·ͨɺWeb Componentsͷ ෦తͳಋೖʹཱͭ
Why we use Web Components?
1. We can use the same component with any JavaScript
Libraries
For example... w 6*ϑϨʔϜϫʔΫΛ౷Ұ͍ͨ͠ +BWB4DSJQUϑϨʔϜϫʔΫ͝ͱʹ6*ϑϨʔϜ ϫʔΫ͍͚Δͷɺޮѱ͍ w ϑϨʔϜϫʔΫΛมߋ͠ͳͯ͘ͳΒͳ͘ͳͬ ͨͱ͖ɺ6*෦Λ͍ճ͢͜ͱ͕Ͱ͖Δ w
֎෦ެ։͍͢͠
2. Fully Scoped
For example... w େ͖͍ϓϩδΣΫτͰ$44ͷґଘ͕ؔ Α͘Θ͔Βͳ͍ͷͰɺHMPCBMͳ$44ʹӨڹ ͞Εͳ͍࣮͕͍ͨ͠ w ֎෦ެ։͍ͨ͠
Demerit w ଐੑʹ4USJOHܕ͔ͤ͠ͳ͍ w ֎෦͔Β͞ΕΔΠϕϯτͷϋϯυϦϯά͕ ͍͠ w %0.ཁૉͷऔΓճ͕͠໘ w $44ͷઃܭΛେ෯ʹݟ͢ඞཁ͕͋Δ
ਖ਼ɺ7VFKTͷػೳΛͬͯίϯϙʔωϯτ ࡞ͬͨ΄͏͕ॊೈͰػೳతͰ؆ܿ
3. Micro Frontends
Micro Frontends? • Be Technology Agnostic • Isolate Team Code
• Establish Team Prefixes • Favor Native Browser Features over Custom APIs • Build a Resilient Site
Think about a web app as a composition of features
Functions Normal Frontend
Function1 Micro Frontend Function2 Function4 Function3
Build a Resilient Site
w CSSͷมߋ w ༻͢ΔϥΠϒϥϦͷมߋ w JavaScriptͷมߋ w DOMߏͷมߋ • etc...
Web ComponentsͳΒ ScopedͳͷͰ มߋ͕༰қ
The biggest change that can be assumed = Framework migration
When Vue.js die, we should think about this
Why didn't we use Web Components earlier...?
ʁ A B A? B?
None
Replacing UI implementation with Web Components, we can respond flexibly
to changing frameworks
ͦΕ͕Webඪ४ͷڧΈ
What will become of us?
Vue.js is replaced by Web Components?
/P
Vue.js (and other frameworks) will be coexistent with Web Components
Web Components Vue.js (and other frameworks) Web Components Web Components
Web Components is "to encapsulate HTML elements"
Vue.js is "To make Web Applications"
5IFZEPOUEJSFDUMZ SFQMBDFCFDBVTF XIBUUIFZXBOUUPSFBMJ[F JTEJ⒎FSFOU
Summary
Summary w 8FC$PNQPOFOUTQSPEVDUJPOSFBEZ ͚ͩͲɺ՝ଟ͍ w 7VFKTͱ8FC$PNQPOFOUTڞଘͰ͖Δ w 6*Λ8FC$PNQPOFOUTʹ·͔ͤΔ͜ͱͰɺ ෛ࠴ΛݮΒ͢͜ͱ͕Ͱ͖Δ
Let's use Web Components!
THANK YOU! (font: Futura, ৽ΰ1SP)