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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
「どのログを見ればいい?」 から始めた サーバーレス障害解析
y_waka1
1
130
Mastering Agentic Development: Harness Engineering for Effective Coding Agents
konippi
1
350
2026-09-18 gotanda.sre Terraformで複数環境作ったり、複数Stateに分割したりそれとTerragrunt / Terraform multi envs and multi states
masasuzu
4
700
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
12k
AIエージェントの一手は 誰も見ていない - Falco拡張OSS「Prempti」とeBPFで サーバーレス実行基盤を二層防御する
keitah
0
500
AIエージェントの自己改善をどう設計するか / How to Design Self-Improvement for AI Agents
22mi
26
17k
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
5
25k
C#コードの結合を可視化する Roslyn解析による設計改善と リファクタリング判断
dora56
0
490
手を動かして実感する、Kiro が変える開発体験
inariku
0
200
技術的負債から考える、AI時代のエンジニアリング投資 — ビズリーチの技術的負債と向き合った経験から、変更し続けられるソフトウェアを考える/ technical-debt-con2026
visional_engineering_and_design
4
3.7k
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
3
2.6k
データ界隈LT祭 第1回LT登壇
taromatsui_cccmkhd
2
1.5k
Featured
See All Featured
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
GitHub's CSS Performance
jonrohan
1033
470k
Practical Orchestrator
shlominoach
192
12k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
530
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
370
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
WCS-LA-2024
lcolladotor
0
830
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
310
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 が変更されても気づく仕組みが作れる
ありがとうございました