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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
naughtLdy
October 02, 2019
Technology
430
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
Transcript
30 slides
メルペイの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 が変更されても気づく仕組みが作れる
ありがとうございました
More Decks by naughtLdy
See All by naughtLdy
What we do for quality as merpay frontend
naughtldy
0
610
Other Decks in Technology
See All in Technology
Intro to Kiro (One agent, every surface) | Kiro: Zero to Hero 01
inariku
PRO
2
140
【Oracle AI SPOTLIGHT ウェビナー】【特別開催:日本語で解説!】Oracle AI World 2026 最新情報フィードバック
oracle4engineer
PRO
1
230
BALLAS Technology Deck
ballas_inc
0
650
サボる子はいねぇがー!AgentCoreハーネスの脆弱性に学ぶ、エージェントの入力バリデーション
iwamot
PRO
5
350
ラクスル会社紹介資料|エンジニア向け / RAKSUL Introduction for Engineers
raksulrecruiting
0
110
An Introduction to Context Ontology Accelerator (teaching AI agents what your data means)
inariku
PRO
1
270
OpenTelemetryで変わった 新時代のCloudWatchメトリクス監視
tsukuboshi
0
220
The Author Pays
hiccupps
0
230
落とし穴にハマってわかった 開発生産性を測るときに気をつけたいこと
munakata
2
230
Steering と Hook (チームの決まりを守らせる) | 目指せ Kiro マスター 06
inariku
PRO
2
130
Context != Context: One window, many lifecycles (AI Native DevCon, Nov 2026)
birgitta410
0
150
_マネジメントする人される人ナイト_2026__良いチームを作っていきたい_お気持ち_.pdf
xkxaxkx
0
540
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Google's AI Overviews - The New Search
badams
0
1.7k
Code Review Best Practice
trishagee
74
20k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
520
Designing Experiences People Love
moore
143
24k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
560
Building the Perfect Custom Keyboard
takai
2
960
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
320
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
Between Models and Reality
mayunak
4
580
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k