Releases: specta-rs/tauri-specta
v2.0.0-rc.25
Changes:
- Upgrade to latest Specta
- Fixing issues with phased types
- Support for semantic types (
Date,Uint8Array,URL, etc.)
New Contributors
- @MangriMen made their first contribution in #216
Full Changelog: v2.0.0-rc.24...v2.0.0-rc.25
v2.0.0-rc.24 - Phasing Forward
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
- @adlrwbr made their first contribution in #154
- @n1ght-hunter made their first contribution in #167
- @vonPB made their first contribution in #174
- @thisislvca made their first contribution in #175
- @petamoriken made their first contribution in #181
- @Hackder made their first contribution in #185
- @reneleonhardt made their first contribution in #196
- @rofinn made their first contribution in #206
Full Changelog: v2.0.0-rc.21...v2.0.0-rc.24
v2.0.0-rc.21
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
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`
Changes:
- Upgrade to Tauri
2.0.0-rc.9
v2.0.0-rc.18 - Tauri `2.0.0-rc.8`
: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`
: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
Changes:
- Improved documentation - Thanks to @kareemmahlees
- Support for generic events
- Bump Tauri version - Thanks to @anatawa12
- Introduce
ErrorHandlingMode- Thanks to @anatawa12
v2.0.0-rc.15 - Fix tailing comma's in macros
Changes:
- Upgrade Specta to v2.0.0-rc.20
- Fix trailing commas in macros
v2.0.0-rc.14 - tauri-rc.0
Changes:
- Upgrade to Tauri-rc.0
- Fix events when used in plugin and app - Thanks to @Brendonovich