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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
3
490
【高い買い物LT会】初任給で話題の国産フィジカルAIを買った話
akagami
PRO
0
140
{ Android | Kotlin } Gradle Plugin in 2026
ryunen344
1
300
Intent as Code
shoppingjaws
6
880
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
0
150
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
130
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
130
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
3
530
【DroidKaigi 2026】「アクセシビリティを利用するとき、 アクセシビリティもまたこちらを利用している」 〜マルウェアによる攻撃と防衛について〜
halunoyo
0
450
App Intentsのビルドプロセスを支える技術
kntkymt
0
230
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
660
AIエージェント時代のコードレビューを設計する
nogu66
6
2.6k
Featured
See All Featured
Practical Orchestrator
shlominoach
191
12k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
330
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
490
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
270
Designing for humans not robots
tammielis
254
26k
A designer walks into a library…
pauljervisheath
211
25k
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ライブラリを作っています まとめ