While v9.0.0 is a technically breaking change, we expect it to be a drop-in replacement for almost all users.
Only code interacting with TS::dependency_types and TS::generics will need to be adjusted.
What's new?
Removal of TypeList
The biggest change of v9.0.0 is an internal one: We removed TypeList from the API.
This fixes the long-standing issue of complex types failing to compile with
overflow evaluating the requirement or
reached the recursion limit
Even if you did not run into those, we do expect this change to also improve compilation times.
Allow for _ in #[ts(as = "..")]
Similar to how it works in serde, _ can be used in #[ts(as = "..")] to refer to the type of the field.
This is particularly useful for more complex type overrides.
Allow #[ts(as = "..")] and #[ts(type = "..")] on structs and enums
These two attributes can now be used directly on structs and enums.
Previously, it was necessary to add these attributes on every field where the type was used.
This feature is particularly useful for exposing newtypes transparently.
To see a list of all changes, check out CHANGELOG.md!
#[serde(with = "...")] requires the use of #[ts(as = "...")] or #[ts(type = "...")] (#280)
Fix incompatibility with serde for snake_case, kebab-case and SCREAMING_SNAKE_CASE (#298)
#[ts(rename_all = "...")] no longer accepts variations in the string's casing, dashes and underscores to make behavior consistent with serde (#298)
Remove TypeList, and replace TS::dependency_types/TS::generics with TS::visit_dependencies/TS::visit_generics.
This finally resolves "overflow evaluating the requirement", "reached the recursion limit" errors.
Also, compile times should benefit. This is a technically breaking change for those interacting with the TS trait
directly. For those just using #[derive(TS)] and #[ts(...)], nothing changes!
Features
Add support for #[ts(type = "..")] directly on structs and enums (#286)
Add support for #[ts(as = "..")] directly on structs and enums (#288)
Add support for #[ts(rename_all = "SCREAMING-KEBAB-CASE")] (#298)
Support _ in #[ts(type = "..")] to refer to the type of the field (#299)
Fixes
Fix #[ts(rename_all_fields = "...")] on enums containing tuple or unit variants (#287)
Fix "overflow evaluating the requirement" and "reached the recursion limit" errors in some cases (#293)
Fix ambiguity causing "multiple applicable items in scope" errors in some cases (#309)
Fix issues with absolute TS_RS_EXPORT_DIR paths (#323)
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 8.1.0 to 9.0.0.
Release notes
Sourced from ts-rs's releases.
... (truncated)
Changelog
Sourced from ts-rs's changelog.
Commits
c7c8ff3
Release v9.0.0c9615f6
update lockfile743e715
prepare release for 9.0.0be0349d
bug: Fix issue with absolute paths (#323)f898578
Insert newline at end of generated files (#321)badbac0
Testing with --no-default-features didnt seem to work in CI (#319)7d28c1a
Rework dependency and generics handling (#306)c5109a0
Coerce passed type to TS before invoking ::name() (#318)d122373
Handle case whereTypePath::qself
isSome
(#310)cb1314d
Fix unqualifiedTS
trait method calls (#309)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