Skip to content

v10.0.0

Compare
Choose a tag to compare
@NyxCode NyxCode released this 19 Sep 19:55
· 9 commits to main since this release

While v10.0.0 is a technically breaking change, we expect it to be a drop-in replacement for almost all users.

Changes to HashMap<K, V> (& friends)

In this release, we've changed how HashMap<K, V> is represented in TypeScript.
Before v10, ts-rs generated { [key: K]: V }. This was never technically correct, resulting in tsc accepting some code which it should not have. Additionally, this resulted in issues when e.g trying to use an enum as key.
With v10, we now generate { [key in K]?: V } instead.

What's New?

  • Multiple types can be exported to the same file using #[ts(export_to = "..")]
  • #[ts(as = "..")] and #[ts(type = "..")] now also work on enum variants
  • Support for more crates (bson, smol_str)

Full changelog

New Contributors