feat(rpc): adopt oRPC v2 for service contracts#114
Conversation
|
Thanks for this PR — it's a serious piece of work, and evaluating it properly What we checked, and what held upWe went through your changes carefully, expecting to find problems, and
So this isn't "the code has problems". It doesn't, beyond a broken example Why we're saying not nowYou saw a reinvented wheel, and that's a fair reading. Here's the deliberate Making oRPC the RPC layer means every user authors contracts and servers Worth being explicit: none of this limits what you build your app with. Where this work fits laterThe direction we've landed on — partly because this PR forced the question:
That's a bigger change than this PR, and it would be unfair to ask you to What we're taking nowComparing the two implementations exposed three gaps in our current code
Thanks again — this genuinely moved the design forward even though it isn't |
What this explores
This concept PR replaces Composer's hand-written RPC protocol layer with native oRPC v2 contracts, routers, and clients.
Composer still owns the differentiated parts: application topology, dependency hydration, per-edge service-key authorization, mount policy, and deployment. oRPC owns the generic RPC machinery: schema execution, transport, routing, structured errors, middleware, metadata, cancellation, and codecs.
Point-to-point example
Define one shared contract with normal oRPC syntax:
Implement it in the private provider:
Declare the service-to-service dependency:
Use the injected typed client from any Fetch-capable framework, including Hono:
The complete call is deliberately boring:
What oRPC brings
The PR also migrates the existing Composer examples and adds a small end-to-end Hono + private Compute service example under
examples/hono-rpc.oRPC v2 is currently beta, so the runtime packages are pinned to the exact same version and Composer's wrapper stays intentionally small.