Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Type Safe "Everything"
Search
andoshin11
March 04, 2020
Technology
0
270
Type Safe "Everything"
andoshin11
March 04, 2020
Tweet
Share
More Decks by andoshin11
See All by andoshin11
Introduction to gRPC Interceptors
andoshin11
0
55
カーナベルにおけるProtobuf二次利用例
andoshin11
0
150
Envoy External AuthZとgRPC Extensionを利用した「頑張らない」Microservices認証認可基盤
andoshin11
0
820
カーナベル株式会社2024年2月 エンジニアイベント資料
andoshin11
0
430
Private Cloudを支える最高のユーザーガイド運用技術
andoshin11
0
300
TS CompilerがVueを喋れても良いじゃないか
andoshin11
0
760
ain't giving up type-safe Express
andoshin11
2
470
Hack your Nuxt router!
andoshin11
0
1.4k
GatewayパターンとSchema駆動開発
andoshin11
7
1.5k
Other Decks in Technology
See All in Technology
regrowth_tokyo_2025_securityagent
hiashisan
0
250
SSO方式とJumpアカウント方式の比較と設計方針
yuobayashi
7
690
20251209_WAKECareer_生成AIを活用した設計・開発プロセス
syobochim
7
1.6k
学習データって増やせばいいんですか?
ftakahashi
2
460
mairuでつくるクレデンシャルレス開発環境 / Credential-less development environment using Mailru
mirakui
5
540
Reinforcement Fine-tuning 基礎〜実践まで
ch6noota
0
190
re:Inventで気になったサービスを10分でいけるところまでお話しします
yama3133
1
120
AWS Security Agentの紹介/introducing-aws-security-agent
tomoki10
0
300
今からでも間に合う!速習Devin入門とその活用方法
ismk
1
750
マイクロサービスへの5年間 ぶっちゃけ何をしてどうなったか
joker1007
12
5.8k
Power of Kiro : あなたの㌔はパワステ搭載ですか?
r3_yamauchi
PRO
0
170
AWS re:Invent 2025で見たGrafana最新機能の紹介
hamadakoji
0
400
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
Faster Mobile Websites
deanohume
310
31k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
390
Navigating Team Friction
lara
191
16k
We Have a Design System, Now What?
morganepeng
54
7.9k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
[SF Ruby Conf 2025] Rails X
palkan
0
540
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Transcript
Type Safe “EVERYTHING” @andoshin11 4. 3. 2020 #tsc_api_study
Who am I ? Shin Ando (a.k.a Andy) @andoshin11 -
Freelance Full-Stack Developer - TypeScript / Vue.js / React / Go / Ruby / Flutter / Terraform / etc… - ❤ Code Generation!
• Powerful editor completion • Easy to analyze code base
using AST • Type-level programming • Overall durability • Maintainable • Scalable • F**king AWESOME!! We all love TypeScript, eh? ❤
However...
Not everyone speaks TypeScript (just yet...)
Not everyone speaks TypeScript (just yet...) • Other programming languages
(Go, Ruby, Python, Java, etc...) • Query based languages (a.k.a Database) • Statically defined specs (YAML, CSV, Markdown, Excel) • etc...
Not everyone speaks TypeScript (just yet...) • Other programming languages
(Go, Ruby, Python, Java, etc...) • Query based languages (a.k.a Database) • Statically defined specs (YAML, CSV, Markdown, Excel) • etc...
Solution (we need)
Basic aproach Parser Transformer TS Compiler 1. Parse input and
tokenize into JSON 2. Transform tokens to TypeScript AST 3. Validate AST and emit useful code Outcome
None
Working Projects
① Typing Database Schema (db-recon) • db-recon ( https://github.com/andoshin11/db-recon )
• Generates type-safe db client for Node.js application • Supports MySQL and MSSQL currently
① Typing Database Schema (db-recon)
① Typing Database Schema (db-recon)
① Typing Database Schema (db-recon)
① Typing Database Schema (db-recon) TODO: • Create SQL-to-AST parser
• Get semantic diagnostics for raw SQL literal string ( ts-sql-plugin requires DSL ) • Rewrite ejs templates with TS Compiler API
② Typing API Request/Response (squelette) • squelette ( https://github.com/andoshin11/squelette )
• Generates type definitions for API request/response from Open API spec • Toolchain to build your own type-safe API client
② Typing API Request/Response (squelette)
② Typing API Request/Response (squelette)
② Typing API Request/Response (squelette)
② Typing API Request/Response (squelette)
② Typing API Request/Response (squelette) TODO: • Rewrite remaining ejs
templates with TS Compiler API • Improve parser and AST format
Latest addition
Improving DX for express.js
Remaining Pains...
Remaining Pains... need manual mapping need to define types may
contain typo
Leads to fatal error in future...
What if...
All handlers are typed like a magic ♂
None
Introducing...
typed-oax
Generate express.d.ts from Open API
Generate express.d.ts from Open API
Generate express.d.ts from Open API
DEMO
typed-oax TODO: • Separate handler types by HTTP Method •
Wrap with TS Plugin?