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
メルペイのTypeScript活用 / TypeScript practical use in...
Search
naughtLdy
October 02, 2019
Technology
420
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
メルペイのTypeScript活用 / TypeScript practical use in Merpay
naughtLdy
October 02, 2019
More Decks by naughtLdy
See All by naughtLdy
What we do for quality as merpay frontend
naughtldy
0
600
Other Decks in Technology
See All in Technology
EventBridge に「合流」はない ― サーバーレスのワークフローを育てるということ / No Join in EventBridge
yusukeshimizu
2
480
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
12k
負債のメタファと2026年 / Debt Metaphor in Agentic Engineering Age 202609 Edition
twada
PRO
11
6.4k
現場で役立つ技術負債の効果的な返済方法
masuda220
PRO
11
5.1k
CLIライブラリ開発を支える技術
htnabe
0
150
AgentCore Runtime上にAgentic Coding基盤を構築・展開する際の設計ポイントと限界点 / Design considerations and limitations when building an agentic coding platform on AgentCore Runtime
har1101
5
700
AIエージェントの一手は 誰も見ていない - Falco拡張OSS「Prempti」とeBPFで サーバーレス実行基盤を二層防御する
keitah
0
500
C#コードの結合を可視化する Roslyn解析による設計改善と リファクタリング判断
dora56
0
490
AI coding 整合正規方法
philipz
0
520
顧客に向き合う開発組織へ。リアーキテクチャとフィーチャーチーム化で挑む組織改革
safie
0
2.4k
AI時代の「技術的負債」の変質ー概念の終焉と再解釈、エージェントと共に向かう先
nwiizo
1
3.2k
その Lambda、8分で 管理者権限まで奪われます
k1nakayama
7
3.6k
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
The Cult of Friendly URLs
andyhume
79
7k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
430
Mind Mapping
helmedeiros
1
370
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
700
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Abbi's Birthday
coloredviolet
4
10k
So, you think you're a good person
axbom
PRO
2
2.2k
Code Reviewing Like a Champion
maltzj
528
40k
Transcript
メルペイのTypeScript活用 TypeScript meetup #3 2019/10/02 Daiki Sugiura
Daiki Sugiura @naughtLdy • Frontend Engineer • メルペイ CS Tool
None
話すこと • メルペイについて • Nuxt.js + TypeScript • TypeScript活用 /
開発について
メルペイについて
プロダクト パートナー向け C向け •キャンペーン(LP) •クーポン •あと払い •オンライン決済 •加盟店申し込みフォーム •加盟店管理画面 •カスタマーサービス
•加盟店サービス 社内向け
技術スタック Application CI / CD Infra Monitoring
プライベートレジストリ APIClient Validation Rules tsconfig protoc-gen-jsonpb-ts lerna
開発フロー GitHub flow Pull Request Lint / Unit Test Code
Review Approved Build Save Container Image Deploy Container Image Create Container Image
Nuxt.js + TypeScript
Nuxt.js + TypeScript 各プロジェクト共通の機能を package として開発 lerna を使って monorepo にしている
• @merpay/api-client • @merpay/protoc-gen-jsonpb-ts • @merpay/tsconfig-merpay • vuex-typescript-fsa
Nuxt+TypeScriptの事始め NuxtMeetup#2 https://speakerdeck.com/sue71/nuxt-and-typescript
TypeScript活用 / 開発について
TypeScriptで得られるメリット • 人間のうっかりを防いでくれる • Vuex (Store)での型安全 • Component の props
での型安全 • API での型安全
TypeScriptで得られるメリット • 人間のうっかりを防いでくれる • Vuex (Store)での型安全 • Component の props
での型安全 • API での型安全
開発について • エンジニアでAPIの仕様を決める • proto ファイルのレビューを Frontend, Backend 双方からする ◦
全サービスの proto を管理しているリポジトリがあり、プルリクベースでレビューする ◦ proto から README も自動で作成される • proto ファイルを TypeScript に変換して開発する ◦ Frontend は mock API を使用して Backend と平行して開発を進めることができる
protocol buffers メルペイでは API の定義に使用している • gRPC用に API仕様を定義するデータフォーマット • proto
ファイルで API 仕様を定義し、各言語向けに変換して使う • TypeScript に変換することで型安全に開発することが容易になる https://developers.google.com/protocol-buffers/
@merpay/protoc-gen-jsonpb-ts • proto ファイルから TypeScript に変換するライブラリ • Nuxt.js (axios) を使う用に特化している
proto
proto TypeScript
Vuex (Store)
store → vue ここから先の話の補足になる Repository naughtLdy/sandbox-typescript-meetup3 https://github.com/naughtLdy/sandbox-typescript-meetup3
store 定義
store → vue
store → vue any型
store → vue string型
Mapper を作って型がわかるようにする https://github.com/naughtLdy/sandbox-typescript-meetup3/blob/master/src/store/helpers.ts\#L148-L163
store → vue any型 string型
開発について TypeScript の恩恵で • 型安全に Backend とやりとりができる • proto が変更されても気づく仕組みが作れる
ありがとうございました