-
Notifications
You must be signed in to change notification settings - Fork 9
support orpc routers #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support orpc routers #105
Conversation
Because oRPC support lazy routers so If you don't care about lazy router, you can use |
commit: |
Perfect, much nicer - thanks @unnoq! Damn you really thought of everything. As I was writing it I was thinking "there should be a method just like this one but that synchronously returns the lazy router paths" and then exactly that exists. Has happened many times with orpc. |
This is included in v0.9.0. |
Hey @mmkal. It's possible to put the trpc/server dep as a development dependency? |
I go back and forth on this. The reason it's a prod dependency is to make it possible to write a CLI just by installing this library on its own. With trpc based CLIs this wasn't a big deal since you'd likely end up with only one version in node_modules even if you have your own separate trpc/server. But with orpc, yes, there will be an unnecessary trpc/server in your/your users' node_modules. Having said that it's a pretty lightweight, has no dependencies itself, and (I'm assuming) only used on servers (node/bun/deno) anyway? Is the concern just install size? |
CC @unnoq
I didn't end up using orpc's json-schema converter - trpc-cli is already doing the conversion to json-schema, presumably a similar way, but I borrowed the use of
resolveContractProcedures
from there.One concern I have is the fact that
resolveContractProcedures
returnsPromise<void>
- I'm calling it from a sync context and would rather not make everything async. It seems to work anyway though, is that expected?