Skip to content

feat: replace hand-written TypeScript types with ts-rs generated bindings - #18

Open
alexmohr wants to merge 4 commits into
mainfrom
feat/ts-rs-generated-types
Open

feat: replace hand-written TypeScript types with ts-rs generated bindings#18
alexmohr wants to merge 4 commits into
mainfrom
feat/ts-rs-generated-types

Conversation

@alexmohr

@alexmohr alexmohr commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces hand-written TypeScript interface/type definitions with auto-generated bindings from Rust types using ts-rs v12. This ensures the frontend types stay in sync with the Rust backend automatically.

Rust side

  • Added ts-rs workspace dependency with serde-json-impl feature (v12.0.1)
  • Added #[derive(TS)] + #[ts(export)] to all DTO types in:
    • src/mdd-core/src/tree/types.rs (19 types)
    • src/mdd-core/src/uds/translator.rs (5 types)
    • src/commands.rs (11 types)
    • src/llm.rs (6 types)

TypeScript side

  • Generated 37 binding files into frontend/src/api/generated/ with barrel index
  • Updated commands.ts to import from generated types instead of local definitions
  • Updated stores/llm.ts to use generated SettingsView, ChatMessage, DeviceFlowStart, etc.
  • Updated SettingsPanel.vue to pass null instead of undefined for nullable fields

Tooling

  • Added .cargo/config.toml alias gen-types for regeneration
  • Added generate-types npm script
  • Set TS_RS_LARGE_INT=number to avoid bigint for u64/i64 fields
  • Configured reuse-annotate to ignore generated files via --ignore-paths

Checklist

  • I have tested my changes locally
  • I have added or updated documentation
  • I have linked related issues or discussions
  • I have added or updated tests

Related

Notes for Reviewers

See individual commit messages for granular changes. To regenerate bindings after Rust type changes: npm run generate-types.

vue-tsc --noEmit and vite build both pass cleanly.


Alexander Mohr alexander.m.mohr@mercedes-benz.com, Mercedes-Benz Tech Innovation GmbH
Provider Information

@alexmohr
alexmohr force-pushed the feat/ts-rs-generated-types branch 8 times, most recently from 2f4f56c to b04bbcf Compare July 8, 2026 12:11
@alexmohr
alexmohr marked this pull request as ready for review July 8, 2026 12:46
@floroks

floroks commented Jul 17, 2026

Copy link
Copy Markdown

is it intentional to have this amount of individual commits for this feature?

@alexmohr

Copy link
Copy Markdown
Contributor Author

is it intentional to have this amount of individual commits for this feature?

It might be a bit too verbose, I will squash before merging.

Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
@alexmohr
alexmohr force-pushed the feat/ts-rs-generated-types branch from 86f0481 to 162fc79 Compare August 5, 2026 13:01
Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
@alexmohr
alexmohr force-pushed the feat/ts-rs-generated-types branch from 6a2022c to 43c601a Compare August 24, 2026 15:08
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.

2 participants