← Dev log

backend

Generated Cross-Language Types

Generated Cross-Language Types

Declare shared types once (here in a Rust crate with no logic) and generate the TypeScript with ts-rs. Check the output into the repo and have CI regenerate and fail on any difference.

The check must catch untracked files too: git diff --exit-code ignores a newly generated file nobody added, and a fresh checkout then fails to build. Both a stale file and a missing variant have broken CI here.

Only generate what the other language uses. Internal wire types didn't need bindings, and a serde internally tagged enum can't be decoded by bincode at all, which a round-trip test caught.

Version fields need distinct names. A wire protocol version and a local IPC protocol version compared with each other produced a UI that refused to start.

Used in: Ferry