Skip to content

Releases: specta-rs/tauri-specta

v2.0.0-rc.25

08 May 00:54

Choose a tag to compare

v2.0.0-rc.25 Pre-release
Pre-release

Changes:

  • Upgrade to latest Specta
  • Fixing issues with phased types
  • Support for semantic types (Date, Uint8Array, URL, etc.)

New Contributors

Full Changelog: v2.0.0-rc.24...v2.0.0-rc.25

v2.0.0-rc.24 - Phasing Forward

30 Mar 14:58

Choose a tag to compare

Pre-release

A huge thanks to Flight Science's for funding me to be able do this work and complete the Specta 2.0.0 vision. A huge debt of gratitude is owed to them for making this all possible!

Upgrade Specta

Upgrade Specta to the latest version!

Ensure you update your dependencies to be the following:

tauri-specta = "=2.0.0-rc.24"
specta = "=2.0.0-rc.24"
specta-typescript = "=0.0.11"

Checkout the v2.0.0-rc.24 and v2.0.0-rc.23 release notes for breaking changes.

Phase-specific types

We we launching support for phase-specific types into Tauri Specta to try out the new Specta APIs. The low-level APIs exposed from Specta are still experimental and may still undergo changes but they are now ready for usage to gather feedback!

This enables types like this to be defined in Rust:

#[derive(Serialize, Deserialize, Type)]
struct PhaseSpecificRename {
    #[serde(rename(serialize = "serialized_value", deserialize = "deserialized_value"))]
    value: String,
}

// This is a Tauri Specta command.
// Tauri Specta uses `specta_serde::apply_phases` to enable this behavior.
#[tauri::command]
#[specta::specta]
fn phase_specific_rename(input: PhaseSpecificRename) -> PhaseSpecificRename {
    input
}

This results in the following in the bindings.ts file:

// ...

export type PhaseSpecificRename = PhaseSpecificRename_Serialize | PhaseSpecificRename_Deserialize;

export type PhaseSpecificRename_Deserialize = {
	deserialized_value: string,
};

export type PhaseSpecificRename_Serialize = {
	serialized_value: string,
};

// ...

export const commands = {
    // Notice how we specialise the types for the usage!
	phaseSpecificRename: (input: PhaseSpecificRename_Deserialize) => __TAURI_INVOKE<PhaseSpecificRename_Serialize>("phase_specific_rename", { input }),
};

This will result in much more accurate types as we can react to the context (Serialize or Deserialize) to generate a better type. We would love you to open issues with feedback as this is a fairly new feature!

You can disable it by using Builder::disable_serde_phases if you would like to restore the previous behavior.

Other

New Contributors

Full Changelog: v2.0.0-rc.21...v2.0.0-rc.24

v2.0.0-rc.21

13 Jan 04:42

Choose a tag to compare

v2.0.0-rc.21 Pre-release
Pre-release

Upgrade Specta to solve #153.

Due to changes that were merged into Tauri this release will be broken until tauri-apps/tauri#12371 is released. In the meantime you can use the following patch:

[patch.crates-io]
# Waiting for release of https://github.com/tauri-apps/tauri/pull/12371
tauri = { git = "https://github.com/tauri-apps/tauri", rev = "75d56e8364fb203387bb5a5235f316dd7dfa6acd" }

v2.0.0-rc.20 - Unlock Tauri Version

18 Sep 12:38

Choose a tag to compare

Pre-release

Enough people have asked and Tauri v2 is close enough to launching so we have unlocked the Tauri version.

If Tauri make breaking changes your application stop compiling so it's reccomended you lock the version using an = at the start of the version. Eg. tauri = "=2.0.0-rc.20".

v2.0.0-rc.19 - Tauri `2.0.0-rc.9`

09 Sep 04:47

Choose a tag to compare

Pre-release

Changes:

  • Upgrade to Tauri 2.0.0-rc.9

v2.0.0-rc.18 - Tauri `2.0.0-rc.8`

02 Sep 22:09

Choose a tag to compare

:tada: Release v2.0.0-rc.18 w/ Tauri 2.0.0-rc.8

v2.0.0-rc.17 - Tauri `2.0.0-rc.3`

17 Aug 05:22

Choose a tag to compare

Pre-release
:tada: Release v2.0.0-rc.17 w/ Tauri  2.0.0-rc.3

v2.0.0-rc.16 - Tauri `2.0.0-rc.2` and more

17 Aug 02:55

Choose a tag to compare

Changes:

v2.0.0-rc.15 - Fix tailing comma's in macros

04 Aug 03:46

Choose a tag to compare

Changes:

  • Upgrade Specta to v2.0.0-rc.20
  • Fix trailing commas in macros

v2.0.0-rc.14 - tauri-rc.0

03 Aug 11:22

Choose a tag to compare

Pre-release

Changes:

  • Upgrade to Tauri-rc.0
  • Fix events when used in plugin and app - Thanks to @Brendonovich