trpc alternatives like zodios, ts-rest

I am using TRPC and really liking the developer experience. I recently got to know about zodios, ts-rest etc. I believe they provide a similar experience but play along more nicely with normal REST api conventions. To use TRPC endpoints from non-typescript backends, we would need to use something like OpenApi adapters. I don't know if the adapters are stable. What are your thoughts on this ? The feeling that i get about these new alternatives is along the lines of, anything that uses a lot of typescript inference will eventually run into scale problems. (slow inference, needing to restart typescript). I even saw some github issues mentioning the typescript inference limit was reached or something. I believe TRPC should be the least risky option when compared to the alternatives.
8 Replies
isaac_way
isaac_way2y ago
trpc-openapi is in fact stable for creating rest endpoints. IMO it's best in cases where you only need to expose a few endpoints via rest, where most of them are only consumed via trpc clients. If all or most of your endpoints need to be exposed via rest, something like zodios might make more sense b/c you're getting the rest endpoints out of the box
Amit
AmitOP2y ago
@iway1 Thanks for the insights. I have not yet tried the new libraries. It will be interesting to see how they compare dx and stability wise.
oljimenez
oljimenez2y ago
I recommend you zodios + openapi-zod-client https://github.com/astahmer/openapi-zod-client
GitHub
GitHub - astahmer/openapi-zod-client: Generate a zodios (typescript...
Generate a zodios (typescript http client with zod validation) from an OpenAPI spec (json/yaml) - GitHub - astahmer/openapi-zod-client: Generate a zodios (typescript http client with zod validation...
unnoq
unnoq2mo ago
I made this one, less verbose - more powerful tRPC, ts-rest, Zodios alternative: https://github.com/unnoq/orpc
GitHub
GitHub - unnoq/orpc: End-to-end typesafe APIs builder, Developer-fi...
End-to-end typesafe APIs builder, Developer-first simplicity - unnoq/orpc
BLANK
BLANK2mo ago
cool to see could you explain more on your thought process for this project and the primitives that allowed you to make an rpc call with typesafety super cool to see
unnoq
unnoq2mo ago
I think I will write about it when oRPC release v1
BLANK
BLANK2mo ago
oh , thats cool
rubberburger
rubberburger2mo ago
just finished setting up ts-rest a while ago haven't tested it extensively yet but looks good so far

Did you find this page helpful?