Generating Types without climbing a tree
summary
Claim: generate TypeScript types and a minimal JS client straight from OpenAPI without manipulating the AST. Uses the tiny code-block-writer library and plain fetch, splits types and code so JavaScript builds stay dependency-free, and intentionally does no runtime validation on the client. Demo shows a generated client, build(url).getMovies()/createMovie(), compiles and runs against a local server, and replaces a slow TypeScript compiler API approach under a tight release deadline.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 0:43Personal journey
- 2:51TypeScript in 2022
- 4:37API client duplication
- 6:45Tight coupling risks
- 8:12Requirements for generation
- 9:54TypeScript compiler challenges
- 11:19code-block-writer library
- 12:45Client generator explained
- 13:52Live demo
- 20:23Q&A
related talks
24mReliable I/O with the TypeScript Compiler API
45mType-Safe APIs - Syncing Back & Front End Types w/ Code Generation
31mBuilding an OpenAPI from Typescript
06mAutomagic TypeScript Codegen for GraphQL
33mTypeScript for APIs
27mWeb applications of the future with TypeScript and GraphQL
30mUsing Hooks and Codegen
30mTypeScript: Gradual, Structural, Dynamic, Static
