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
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
1
2k
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
130
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
310
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
380
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
290
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
130
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
460
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
460
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5.2k
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
260
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
200
Featured
See All Featured
KATA
mclloyd
PRO
35
16k
エンジニアに許された特別な時間の終わり
watany
109
250k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
260
Building a Scalable Design System with Sketch
lauravandoore
464
34k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
3
4.3k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
490
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
540
How Software Deployment tools have changed in the past 20 years
geshan
2
34k
The SEO Collaboration Effect
kristinabergwall1
1
580
Bash Introduction
62gerente
615
220k
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ライブラリを作っています まとめ