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
WebComponent
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
milkmidi
August 12, 2023
Programming
3.3k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
WebComponent
2023 Webconf - WebComponent
milkmidi
August 12, 2023
More Decks by milkmidi
See All by milkmidi
202512-WebConfig 大 AI 時代,工程師的成長之路
milkmidi
0
560
202403-WebComponent
milkmidi
0
260
前端好朋友-tailwindcss
milkmidi
0
8.7k
202110-federation
milkmidi
0
210
Vue3一次就上手
milkmidi
0
6.4k
202007-React對戰雷台
milkmidi
0
210
Other Decks in Programming
See All in Programming
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
780
contenteditable と日本語入力に向き合う
colorful12
0
190
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
110
Simple Storage Service(S3) is not simple
iwatsukayura
0
280
phperだってパンチカードでコーディングしたい
o0h
PRO
0
310
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
250
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
160
最近”作らせてる” ローカルAIアプリの話
akit37
0
460
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
480
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
390
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
22
22k
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
174
15k
Speed Design
sergeychernyshev
33
2.2k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
620
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
490
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
260
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
740
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
730
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
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 圖片出處