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
「defineCustomElement」を活用した サービス共通のUIコンポーネントライブラリ
Search
piyoppi
November 21, 2023
Programming
1.4k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
「defineCustomElement」を活用した サービス共通のUIコンポーネントライブラリ
piyoppi
November 21, 2023
Other Decks in Programming
See All in Programming
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
110
スマート反転とウェブアクセシビリティ
camiha
0
210
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
7.1k
Security issues being discussed on Web Platforms
petamoriken
0
940
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
140
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
250
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
140
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
3
550
SONY CISC-NEWS NWS-1750 + NWB-225 フレームバッファの NetBSD/news68k ドライバ実装 / OSC2026Hiroshima
tsutsui
0
110
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
690
DroidKaigi 2026 「個人開発という実験場: Android エンジニアが手にする4つの自由」
slashnephy
0
230
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
1.8k
Featured
See All Featured
A better future with KSS
kneath
240
18k
How Software Deployment tools have changed in the past 20 years
geshan
1
34k
Site-Speed That Sticks
csswizardry
13
1.5k
Claude Code のすすめ
schroneko
67
230k
Crafting Experiences
bethany
1
340
Done Done
chrislema
186
16k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
450
Heart Work Chapter 1 - Part 1
lfama
PRO
10
36k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
660
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
420
Fireside Chat
paigeccino
43
4k
Transcript
1 「defineCustomElement」を活⽤した サービス共通のUIコンポーネントライブラリ 尾形 将平 GMOペパボ株式会社 EC事業部 エンジニア 2023.10.28
2 ⾃⼰紹介 EC事業部 プロダクトチーム 尾形 将平 Shohei Ogata • ECプラットフォーム「カラーミーショップ」の 開発に従事
• Vue.js歴は概ね4年くらい • GitHub : @piyoppi
ECプラットフォーム「カラーミーショップ」 3 インターネットで商いを⽀援
「カラーミーショップ」とVue.js 4 アプリストア カラーミーショップとVue.js ショップ管理画⾯ 社内ツール などなど...
「カラーミーショップ」とVue.js 5 ショップ管理画⾯ • PHP + jQuery のMPA • ショップデザイン
/ 商品管理 / 発送 など... • 2021年〜からVue.js (Custom Element)を利⽤
「カラーミーショップ」とVue.js 6 ショップ管理画⾯とVue.js • 2021〜 Vue2系 + Vue CLI Web
Components Build ◦ https://tech.pepabo.com/2021/03/23/admin-ui-components/ • 2022〜 Vue3系 + defineCustomElement ◦ https://tech.pepabo.com/2022/10/31/colorme-vue3-migration/ • 2023〜 ペパボ共通デザインシステム「Inhouse」導⼊ ◦ https://note.com/colorme_design/n/n6e3499aa25d3
Custom Element変換層の導⼊による UIコンポーネントライブラリの開発 7
Custom Element変換層の導⼊によるUIコンポーネントライブラリの開発 8 ce-proxy ui-components .ts .css vue-application .js .ce.js
web-application <script src=”ce-proxy.js”> <c-button> ボタン </c-button> defineCustomElement()
9 custom-elements-proxy ui-components .ts .css vue-application .js .ce.js web-application <script
src=”ce-proxy.js”> <colorme-button> ボタン </colorme-button> defineCustomElement() • SFC(.vue)をそれぞれビルド • SFC毎に .ts & .css ファイルを公開 Custom Element変換層の導⼊によるUIコンポーネントライブラリの開発 c-button .vue c-radio .vue c-button .vue.ts c-button .css c-radio .vue.ts c-radio .css … …
ce-proxy vue-application .js .ce.js web-application <script src=”ce-proxy.js”> <colorme-button> ボタン </colorme-button>
defineCustomElement() 10 • ui-componentsが公開するSFCを利⽤ ◦ スタイルの読み込みはViteプラグインで⾃動化している Custom Element変換層の導⼊によるUIコンポーネントライブラリの開発 <template> <div> <c-button>ボタン</c-button> </div> </template> <script setup lang=”ts”> import CButton from “ui-components/c-button.vue” import “ui-components/c-button.css” </script>
ce-proxy vue-application .js .ce.js web-application <script src=”ce-proxy.js”> <colorme-button> ボタン </colorme-button>
defineCustomElement() 11 • defineCustomElement() を通して Custom Element化 • 属性値を Vue props にそのまま渡 せない場合の変換層としても機能 Custom Element変換層の導⼊によるUIコンポーネントライブラリの開発 ce-proxy ui-components JSON HTML </> component Object component
ce-proxy vue-application .js .ce.js web-application <script src=”ce-proxy.js”> <colorme-button> ボタン </colorme-button>
defineCustomElement() 12 • コンポーネント毎にJavaScriptを出⼒ • 必要なコンポーネントを検索して取得 するスクリプトを同梱 ◦ よく使うコンポーネントはスクリプトに同梱してネットワー クの往復による遅延を低減 Custom Element変換層の導⼊によるUIコンポーネントライブラリの開発 <script src=”ce-proxy.js”> <B>foo</B> <C>bar</C> ce-proxy.js C A.js A B.js B
13 • ce-proxyをロード • ui-components が公開するSFCを ce-proxyを介して利⽤できる web-application <script src=”ce-proxy.js”>
<c-button> ボタン </c-button> Custom Element変換層の導⼊によるUIコンポーネントライブラリの開発
14 • カラーミーショップではdefineCustomElement() を 活⽤しています • カスタム要素の変換層を作ることでより再利⽤性の ⾼いUIライブラリを作っています まとめ