Replies: 1 comment
-
I'd like to add to this, I've experienced significant IDE performance issues from chaining everything together. To the point where it was unusable and is a big blocker for me. I've followed the different guides about app splitting but I ultimately found if everything is chained together then there will still be a huge IDE performance cost of TS trying to infer all the types. I define the Zod Open API routes separately in my monorepo with |
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
-
Hi everyone!
First of all, thank you, @yusukebe, for the great work you've done!
I have a question: Is there any option to build an RPC client (using AppType from the docs) without chaining all the routes together?
The documentation suggests that something like this is possible:
However, there's a significant issue: Is it possible to access something like
typeof routes
without relying on extensive global method chaining? I'm thinking of something liketypeof app.routes
or a similar alternative.Apart from the inconvenience of chaining all methods, there's an issue with Zod-OpenAPI. While Zod-OpenAPI works wonderfully (again, thank you, Wada-sensei!), the problem arises because
app.openapi
doesn't accept parameters likeapp.route
.Using
app.route('/prefix', new OpenAPIHono())
results in losing route information, leaving the client empty and the IDE indicating thattypeof routes
is also empty.Given that chaining all the app routes together — especially when using OpenAPI (which adds complexity) — is cumbersome, how should I handle this situation?
And is there a way to call typeof routes without chaining all the server's handlers?
Beta Was this translation helpful? Give feedback.
All reactions