Skip to content

deps: keep specta=2.0.0-rc.22 / tauri-specta=2.0.0-rc.21 — specta-serde breaks bindings codegen on rc.24+ #204

Description

@Map1en

Summary

The tauri-specta IPC codegen toolchain is pinned to pre-release exact versions:

  • specta = "=2.0.0-rc.22" (workspace Cargo.toml)
  • tauri-specta = "=2.0.0-rc.21" and specta-typescript = "0.0.9" (src-tauri/Cargo.toml)

Do not upgrade to rc.24+.

Why

rc.24 introduces specta-serde, which breaks this repo two ways:

  1. Unified mode (disable_serde_phases) rejects any #[serde(skip_serializing_if)] — we have 36 such fields, and #[specta(optional)] does not suppress the error.
  2. Phased mode infinitely recurses / hangs on serde_json::Value's inline self-referential Type impl.

rc.21/rc.22 are pre-specta-serde; neither problem exists.

Additionally, the Type trait signature changed: rc.22 uses fn inline(type_map, generics), rc.25 changed it to definition(types). Our hand-written Type impls (AppError → String, OverlayActivityFavoriteGroupKeys) use the rc.22 inline signature, so an upgrade also requires rewriting those.

Codegen context

Commands = #[tauri::command] + #[specta::specta], listed once in collect_commands![] in src-tauri/src/bindings_export.rs; npm run generate:tauri-bindings regenerates src/platform/tauri/bindings.ts. patch_bindings() applies 3 deterministic patches (notably serde_json::Value → any, related to specta-rs/specta#166). CI tauri-bindings job guards against drift.

Upstream

Unpin criteria

  • A specta/tauri-specta release where: (a) #[serde(skip_serializing_if)] fields don't error under serde validation, and (b) serde_json::Value doesn't hang codegen.
  • Migrate the hand-written Type impls to the new definition(types) signature.
  • Verify: npm run generate:tauri-bindings completes and the resulting bindings.ts matches the committed one (modulo the 3 intended patches); cargo check --manifest-path src-tauri/Cargo.toml passes; CI tauri-bindings job stays green.

Dependabot

Enforced via ignore rules for specta / tauri-specta / specta-typescript in .github/dependabot.yml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaledependenciesPull requests that update a dependency filerustPull requests that update rust code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions