Proposal: Adopt zod_gen to generate TS types + Zod schemas from Rust DTOs (reduce duplicated API structs) #1154
TheBest6337
started this conversation in
Architecture
Replies: 1 comment
-
|
(Answer from @Oshgnacknak ) I might take a look into this further, once we've done the WAGO todos. Generating (string literals containing) front-end code seems valid for our use case. Mutations, State Events and LiveValues might be generatable in the front-end. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
(Moved from @15i1i-s7v's Issue: #986)
Context
What is zod_gen?
export const XSchema = ...; export type X = z.infer<typeof XSchema>;Refs:
Why this might help QiTech long-term
Costs / Risks / Unknowns
Alternatives
Proposed Spike (PoC) plan
#[derive(ZodSchema, Serialize, Deserialize)]on these Rust types.electron/src/generated/schemas.ts.XSchema.parse(...)(or safeParse) in the electron boundary (REST/socket event handler).Success criteria (to decide "go / no-go")
Non-goals (for this issue)
Beta Was this translation helpful? Give feedback.
All reactions