Company
Date Published
Author
Jonas Platte
Word count
1833
Language
English
Hacker News points
None

Summary

The Svix SDKs have been overhauled with a new code generator, which aims to simplify the development process for building secure and reliable webhook platforms. The old scheme of having internal generated code and hand-written public API was replaced by generating high-level APIs using a templating engine. This allowed for consistency across languages and reduced manual work required when adding new endpoints. The new tool uses MiniJinja, a Rust implementation of Jinja2, to generate templates that were previously written in mustache. The generator has resulted in smaller JavaScript bundles and improved maintainability, with the only hand-written parts being those not directly related to API calls. The effort also enabled a rewrite of the CLI from Go to Rust, achieving parity with the old codebase without much additional work.