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
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 supports bson::oid::ObjectId as well (#340)
Add support for types from smol_str behind cargo feature smol_str-impl (#350)
Support #[ts(as = "...")] and #[ts(type = "...")] on enum variants (#384)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps ts-rs from 9.0.1 to 10.0.0.
Release notes
Sourced from ts-rs's releases.
Changelog
Sourced from ts-rs's changelog.
Commits
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 CHANGELOGDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show