Sourced from ts-rs's releases.
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 intsc
accepting some code which it should not have. Additionally, this resulted in issues when e.g trying to use anenum
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 Aleph-Alpha/ts-rs#339- feat: add bson ObjectId impl by
@ShaunSHamilton
in Aleph-Alpha/ts-rs#340- Fix JSDoc formatting for Rust block comments by
@gustavo-shigueo
in Aleph-Alpha/ts-rs#342- Fix error in internally tagged enums with flattened fields by
@gustavo-shigueo
in Aleph-Alpha/ts-rs#344- feat: Allow multiple types to set
#[ts(export_to = "...")]
to the same file by@escritorio-gustavo
in Aleph-Alpha/ts-rs#316- Always use forward slash on import paths by
@gustavo-shigueo
in Aleph-Alpha/ts-rs#346- feature: support smol_str by
@corvusrabus
in Aleph-Alpha/ts-rs#350- Support
#[ts(as = "...")]
and#[ts(type = "...")]
on enum variants by@escritorio-gustavo
in Aleph-Alpha/ts-rs#284New Contributors
@ShaunSHamilton
made their first contribution in Aleph-Alpha/ts-rs#340@corvusrabus
made their first contribution in Aleph-Alpha/ts-rs#350
Sourced from ts-rs's changelog.
master
Breaking
- Change how
HashMap<K, V>
is represented in TypeScript. The resulting bindings ({ [key in K]?: V }
instead of{ [key: K]: V }
) are more accurate and flexible.Features
- Allow multile types to have the same
#[ts(export_to = "...")]
attribute and be exported to the same file (#316)- The
bson-uuid-impl
feature now supportsbson::oid::ObjectId
as well (#340)- Add support for types from
smol_str
behind cargo featuresmol_str-impl
(#350)- Support
#[ts(as = "...")]
and#[ts(type = "...")]
on enum variants (#384)Fixes
0d92a2b
release v10.09763ca0
Support #[ts(as = "...")]
and #[ts(type =
"...")]
on enum variants (#284)6651d92
Fix smol_str-impl feature name in lib.rsfb47428
Fix smol_str-impl feature name in test61a6d6a
Fix smol_str-impl feature name7577aca
feature: support smol_str (#350)78591a2
Always use forward slash on import paths (#346)5cbc740
feat: Allow multiple types to set #[ts(export_to =
"...")]
to the same file...5c3b8c9
Fix error in internally tagged enums with flattened fields (#344)7ee0cbc
Update CHANGELOG