t
tRPC
t
tRPC
Access Input Schemas in client
Original message was deleted
tRPC
Join
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,111
Members
View on Discord
N
Nick
•
3/24/23, 7:02 PM
You can put your schema types in a library and import the library
. Zod works on the client and server
N
Nick
•
3/24/23, 7:16 PM
When you import the AppRouter type that can be stripped at build time
N
Nick
•
3/24/23, 7:17 PM
When you import a concrete thing
, the backend has to be compiled
, and might be compiled in the context of your frontend which doesn
’t have node or v8 modules
N
Nick
•
3/24/23, 7:18 PM
You might even bundle your whole backend which is a bad thing
N
Nick
•
3/24/23, 7:18 PM
Move the Zod types into a separate library to share them
N
Nick
•
3/24/23, 10:18 PM
Not possible unfortunately
, because the client doesn
’t actually know anything about the API at run
-time
. It
’s all typescript types