(no title)
dharmaturtle | 3 years ago
Edit: so far, I'm preferring trpc, because it has support for zod and a few other libraries https://trpc.io/docs/v9/router
It seems like this library has its own bespoke syntax for types https://telefunc.com/typescript
brillout|3 years ago
Less boierlplate.
> so far, I'm preferring trpc, because it has support for zod
What's your use case for wanting zod instead of https://telefunc.com/shield#all-types?
neonedge|3 years ago
Telefunc should support zod, why shouldn't it? Just pass them as native zod types and all good. You could also convert them before with z.infer but you don't need to.
> It seems like this library has its own bespoke syntax for types
Only for stacks which don't transpile server-side code. You can use normal TS types with something like Next, Nuxt, Svelte, Vite, etc. So, these bespoke types aren't relevant for the majority.
dharmaturtle|3 years ago
I believe this is only the case with routes, and they're still statically typed. E.g. if you only define `/getUser` and try to invoke `/gteUsre`, it will yell at you.
> Telefunc should support zod, why shouldn't it? Just pass them as native zod types and all good. You could also convert them before with z.infer but you don't need to.
Can you elaborate on this? AFAIK it only supports the types listed here https://telefunc.com/shield#all-types So my understanding is that you can't pass native zod types.
brillout|3 years ago
What's your use case for wanting zod instead of https://telefunc.com/shield#all-types?
cehrlich|3 years ago