Skip to content

Bump ts-rs from 10.1.0 to 11.0.1 in /rust in the major group #7573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jun 23, 2025

Bumps the major group in /rust with 1 update: ts-rs.

Updates ts-rs from 10.1.0 to 11.0.1

Release notes

Sourced from ts-rs's releases.

v11.0.0

We are excited to announce v11.0.0!

Upgrading from v10.x.x

  • With the serde-compat feature enabled (default), fields annotated with both #[serde(skip_serializing(_if))] and #[serde(default)] are now turned into optional properties.
    See "Improved serde compatibility" under "New features" below
  • The API of the ts_rs::TS trait has slightly changed.
    Some trivial adjustments to your code might be necessary, though only if you interact with ts_rs::TS directly.
    Most users should not be affected by this.

New features

Everything's optional!

With v11, we introduce #[ts(optional_fields)], which can cut down on annoying boilerplace.
This attribute can be applied to structs and has the same effect as adding #[ts(optional)] to every field.

Example:

#[derive(TS)]
#[ts(optional_fields)]
struct Form {
  first_name: Option<String>, // first_name?: string
  last_name: Option<String>, // last_name?: string
  email: Option<String>, // email?: string
}

Improved serde compatibility

In the past, #[serde(skip_serializing)] and #[serde(skip_serializing_if = "..")] were ignored by ts-rs.
With v11, we now take these attributes into account, as long as they are used together with #[serde(default)].
This ensures that the generated type is valid for both serializing and deserializing rust structures by default.

A field annotated with #[serde(skip_serializing_(if))] and #[serde(default)] will be treated as if it was annotated with #[ts(optional = nullable)].
This behavior can be overridden using #[ts(optional = false)].

Example:

// now generates `type User = { nickname?: string | null }`, 
// making it correct for both serialization and deserialization by default.
#[derive(Serialize, Deserialize, TS)]
struct User {
  #[serde(skip_serializing_if = "Option::is_none", default)]
  nickname: Option<String>,
}

More flexible attributes

#[doc = ..], #[ts(rename = "..")] and #[ts(export_to = "..")] now accept arbitrary expressions!
This enables some cool new patterns and makes integrating ts-rs in unusual setups easier.

Example:

... (truncated)

Changelog

Sourced from ts-rs's changelog.

11.0.1

Fixes

  • Fix usage of #[ts(optional)] together with #[ts(type)]. (#416)

11.0.0

Breaking

  • #[serde(skip_serializing)] and #[serde(skip_serializing_if = ..)] are no longer ignored when used together with #[serde(default)]. (#393)
  • Changed return type of TS::output_path() from Option<&'static Path> to Option<PathBuf>.
    This will only break your code if you manually implement TS or directly interact with the TS trait.
  • Replaced TS::DOCS with TS::docs().
    This will only break your code if you manually implement TS or directly interact with the TS trait.
  • Added OptionInnerType associated type to the TS trait. If you manually implement TS, you must set this associated type to Self in all of your implementations.
  • Raised MSRV to 1.78.0 due to use of #[diagnostic::on_unimplemented] and let ... else { ... }

Features

  • Add support for #[serde(skip_serializing)] and #[serde(skip_serializing_if = ..)] when used together with #[serde(default)]. Since these fields might be absent(#393)
  • Add support for arbitrary expressions in doc attributes, e.g #[doc = concat!("defined in ", file!())]. This would result both in a rustdoc and JSDoc comment.
  • The #[ts(rename)] attribute on structs, enums and variants now accepts any expression.
    This makes it possible to, for example, rename a struct to the name of a module it is contained in using #[ts(rename = module_path!().rsplit_once("::").unwrap().1)]
  • The #[ts(export_to)] attribute on structs and enums now accepts any expression.
  • Added #[ts(optional_fields)] and #[ts(optional_fields = nullable)] attribute to structs, this attribute is equivalent to using the corresponding #[ts(optional)] or #[ts(optional = nullable)] on every field of the struct. (#366)

Fixes

  • Fix #[ts(optional)] error when using a type alias for Option or fully qualifying it as core::option::Option (#366)
  • Fix missing import statements when using #[ts(as = "...")] at the top level of a struct/enum (#385)
  • Fix missing inline_flattened implementation for HashMap
Commits

Dependabot compatibility score

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 <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore <dependency name> major version will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
  • @dependabot ignore <dependency name> minor version will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
  • @dependabot ignore <dependency name> will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
  • @dependabot unignore <dependency name> will remove all of the ignore conditions of the specified dependency
  • @dependabot unignore <dependency name> <ignore condition> will remove the ignore condition of the specified dependency and ignore conditions

Bumps the major group in /rust with 1 update: [ts-rs](https://github.com/Aleph-Alpha/ts-rs).


Updates `ts-rs` from 10.1.0 to 11.0.1
- [Release notes](https://github.com/Aleph-Alpha/ts-rs/releases)
- [Changelog](https://github.com/Aleph-Alpha/ts-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Aleph-Alpha/ts-rs/commits)

---
updated-dependencies:
- dependency-name: ts-rs
  dependency-version: 11.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Jun 23, 2025
@dependabot dependabot bot requested a review from a team as a code owner June 23, 2025 12:15
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Jun 23, 2025
Copy link

vercel bot commented Jun 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
modeling-app ❌ Failed (Inspect) Jun 23, 2025 0:20am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants