Automatically generating types for Cloudflare Workers
Brendan Coll built an automated pipeline to generate Rust and TypeScript types for Workers runtime. The pipeline runs every time the Workers runtime code is built, generating types for both repositories and a JSON file containing intermediate representation of static types. This ensures that the static types are always accurate and up-to-date. The auto-generated types can be used in TypeScript projects by installing @cloudflare/workers-types and adding it to the project's tsconfig.json file. Cloudflare also open-sourced the type information itself in JSON format, allowing anyone interested to create type data for any language they'd like.
Company
Cloudflare
Date published
Nov. 16, 2021
Author(s)
Brendan Coll, Jonathan Kuperman
Word count
817
Hacker News points
57
Language
English