v10.0.0
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
- Change
HashMap
to export mapped types by @gustavo-shigueo in #339 - feat: add bson ObjectId impl by @ShaunSHamilton in #340
- Fix JSDoc formatting for Rust block comments by @gustavo-shigueo in #342
- Fix error in internally tagged enums with flattened fields by @gustavo-shigueo in #344
- feat: Allow multiple types to set
#[ts(export_to = "...")]
to the same file by @escritorio-gustavo in #316 - Always use forward slash on import paths by @gustavo-shigueo in #346
- feature: support smol_str by @corvusrabus in #350
- Support
#[ts(as = "...")]
and#[ts(type = "...")]
on enum variants by @escritorio-gustavo in #284
New Contributors
- @ShaunSHamilton made their first contribution in #340
- @corvusrabus made their first contribution in #350