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
WebComponent
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
milkmidi
August 12, 2023
Programming
1
3.2k
WebComponent
2023 Webconf - WebComponent
milkmidi
August 12, 2023
Tweet
Share
More Decks by milkmidi
See All by milkmidi
202512-WebConfig 大 AI 時代,工程師的成長之路
milkmidi
0
250
202403-WebComponent
milkmidi
0
190
前端好朋友-tailwindcss
milkmidi
0
8.4k
202110-federation
milkmidi
0
150
Vue3一次就上手
milkmidi
0
6.3k
202007-React對戰雷台
milkmidi
0
190
Other Decks in Programming
See All in Programming
Grafana:建立系統全知視角的捷徑
blueswen
0
300
dchart: charts from deck markup
ajstarks
3
970
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.7k
AI Agent Dojo #4: watsonx Orchestrate ADK体験
oniak3ibm
PRO
0
130
re:Invent 2025 トレンドからみる製品開発への AI Agent 活用
yoskoh
0
690
Vibe codingでおすすめの言語と開発手法
uyuki234
0
190
CSC307 Lecture 05
javiergs
PRO
0
480
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
590
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
390
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.2k
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.6k
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
180
Featured
See All Featured
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
170
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Code Review Best Practice
trishagee
74
19k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
Mobile First: as difficult as doing things right
swwweet
225
10k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
42
Making the Leap to Tech Lead
cromwellryan
135
9.7k
ラッコキーワード サービス紹介資料
rakko
1
2.1M
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
160
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
Transcript
如何⽤ React 發⼤財 WebComponent 202308 - milkmidi
milkmidi (奶綠茶) PositiveGrid Staff Frontend Engineer
[email protected]
https: / / www.facebook.com/milkmidifans
Ten years ago!
jQuery Flash Action Script Silverlight RWD 是三⼩! bootstrap
10 年前奶綠出過兩本書 已絕版 每年都要拿 Flash 出來鞭⼀下
Web Development Trends in 2023 React / Vue / Angular
Flash Action graphQL TailwindCSS webassembly Webpack / Vite No jQuery Test
我也想靠 Flash 吃⼀輩⼦呀 結果 Jobs ⼀句話我就失業了
Why WebComponent?
PM 要請你修改 sign-in 功能,這時你會 ?
jQuery 再戰⼗年
None
None
None
WebComponent 是你的救贖
None
None
1 好找,好改 2 限縮 JS scope 3 準時下班
PM說: 現在要修改登出鈕按的⾏為。 不急,⼗分鐘後再給我就好
這時你要回答?
None
要使⽤前有個 But ⼈⽣就是這個 But
None
How to use?
None
None
connectedCallback() Invoked when the custom element is first connected to
the document's DOM. disconnectedCallback() Invoked when the custom element is disconnected from the document's DOM. attributeChangedCallback() Invoked when one of the custom element's attributes is added, removed, or changed. Life cycle callbacks
attributeChangedCallback
Shadow DOM 與世隔絕的安全⼩屋 這我家的貓,很可愛吧
None
外層和 Shadow DOM 的 style 不會互相影響 但,也是缺點 透過 attachShadow( {
mode } ); 可以讓外層的 JS 是否可以呼叫 shadowDOM 裡的元素 mode: open:element.shadowRoot // ShadowRoot obj mode: closed: element.shadowRoot // null
Shadow DOM + slot 這我家的貓,很可愛吧
None
下段語法寫錯,正確為 document.createElement(‘my-component’)
Web Component 就是這麼簡單
加薪技能樹
WebComponent + petite-vue
None
都是尤⼤⼤開發的 Only ~ 6kb DOM-based, mutates in place(not virtual DOM)
petite-vue
None
None
https://www.positivegrid.com/products/spark 實際應⽤
None
WebComponent 限縮 scope petite-vue 處理阿雜的 DOM 事件 本來專案就走 SSR 的情況下,很適合導入
工具沒有好或壞 用的好帶你上天堂 還是我家的貓,還是很可愛
學習不需要為公司、長官或同事, 不需要為別人,只為你自己。 五倍紅寶石-高見龍
⼯商服務 Positivegrid 徵 Senior Android Engineer Senior Backend Engineer Machine
Learning Engineer C++ Developer
QA
https://www.facebook.com/cmoneyengineer/photos https://www.facebook.com/groups/2616981278627207 圖片出處