The beauty of telefunc is the auto type validation but I can't express an email or password type well in TS. Both can be checked in the client via HTML Input types but we'd need to check them on the server as well. We could do this manually or employ another val lib like zod but then we'd need to build another infrastructure for the second validation lib, its error handing, etc. Then, why do we have telefunc's auto val in the first place?
And even if we built the second val infrastructure, we'd need to double the zod def or val contract and the RPC function signature/parameters. We could infer from the zod type but would end up with additional boilerplate and/or ruin the simple telefunc api.
I currently use zod, where you have turn-key types for email or can easily set that the password has a min length and so on. TS still lacks and will for some time regex types, check also https://github.com/microsoft/TypeScript/issues/41160#issuecomment-1503653578 so I wonder, how telefunc should work IRL without these types.
I really want to use telefunc and hope I miss something...
The beauty of telefunc is the auto type validation but I can't express an email or password type well in TS. Both can be checked in the client via HTML Input types but we'd need to check them on the server as well. We could do this manually or employ another val lib like zod but then we'd need to build another infrastructure for the second validation lib, its error handing, etc. Then, why do we have telefunc's auto val in the first place?
And even if we built the second val infrastructure, we'd need to double the zod def or val contract and the RPC function signature/parameters. We could infer from the zod type but would end up with additional boilerplate and/or ruin the simple telefunc api.
I currently use zod, where you have turn-key types for email or can easily set that the password has a min length and so on. TS still lacks and will for some time regex types, check also https://github.com/microsoft/TypeScript/issues/41160#issuecomment-1503653578 so I wonder, how telefunc should work IRL without these types.
I really want to use telefunc and hope I miss something...