Draft
Conversation
… 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.
13fa8bc to
27f1b57
Compare
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Key changes
FunctionResultVariant→FunctionReturnTypespectafeatureexport→collectts::datatype()→ts::primitives::inline()Typescriptstruct now wrapsExporter(no more direct field access toframework_header,header,formatter)TypeCollection::remove()removed (Channel type now handled as opaque reference in specta)Function::args()returns&[...]slice instead of iteratorexport.rsto useTypescript::export()for full type outputErrorenum to deriveserde::Serialize(spectaTypederive no longer processes#[serde]attributes)Test plan
cargo checkpasses for taurpc workspacecargo checkpasses for example apppnpm buildsucceedspnpm lintpasses (format, types, eslint)