Skip to content

Upgrade specta to v2.0.0-rc.23#11

Draft
johncarmack1984 wants to merge 7 commits intomainfrom
john/move-to-specta-rc-23
Draft

Upgrade specta to v2.0.0-rc.23#11
johncarmack1984 wants to merge 7 commits intomainfrom
john/move-to-specta-rc-23

Conversation

@johncarmack1984
Copy link
Copy Markdown
Collaborator

Summary

  • Upgrades specta from v2.0.0-rc.22 to v2.0.0-rc.23
  • Upgrades specta-typescript from v0.0.9 to v0.0.10
  • Upgrades specta-serde from v0.0.9 to v0.0.10
  • Adapts taurpc to breaking API changes across the specta ecosystem

Key changes

  • FunctionResultVariantFunctionReturnType
  • specta feature exportcollect
  • ts::datatype()ts::primitives::inline()
  • Typescript struct now wraps Exporter (no more direct field access to framework_header, header, formatter)
  • TypeCollection::remove() removed (Channel type now handled as opaque reference in specta)
  • Function::args() returns &[...] slice instead of iterator
  • Simplified export.rs to use Typescript::export() for full type output
  • Fixed example Error enum to derive serde::Serialize (specta Type derive no longer processes #[serde] attributes)

Test plan

  • cargo check passes for taurpc workspace
  • cargo check passes for example app
  • pnpm build succeeds
  • pnpm lint passes (format, types, eslint)

… v0.0.10

- specta: export feature renamed to collect, FunctionResultVariant
  renamed to FunctionReturnType, TypeCollection::remove() removed,
  Function::args() returns slice instead of iterator
- specta-typescript: Typescript now wraps Exporter, framework_header
  replaced by framework_prelude, ts::datatype() replaced by
  ts::primitives::inline(), formatter removed
- Simplified export.rs to use Typescript::export() for full type
  output instead of manually splitting by framework_header
- Fixed example Error enum to derive serde::Serialize (required now
  that specta::Type no longer processes #[serde] attributes directly)
Functions with types unsupported by the TS exporter (e.g. tauri::ipc::Channel)
are now silently filtered out rather than printing an error and emitting an
empty function group.
@johncarmack1984 johncarmack1984 force-pushed the john/move-to-specta-rc-23 branch from 13fa8bc to 27f1b57 Compare March 14, 2026 05:28
- Replace Channel opaque references with TAURI_CHANNEL<T> defines since
  specta-typescript doesn't support the Channel opaque natively
- Use named type references (e.g. User) instead of inline struct
  definitions in generated function signatures
- Collapse Option<()> to null instead of null | null
- Insert boilerplate import after framework header without discarding
  specta output
- Run pnpm format after type export in example app

Note: specta rc.23 changes how #[serde(skip)] interacts with adjacently
tagged enums, producing { type: "Io"; data: { type: "Io" } } instead of
{ type: "Io" } for the Error type. This is a specta behavioral change,
not something we control in the export pipeline.
@johncarmack1984 johncarmack1984 marked this pull request as draft March 16, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant