🚀 Road to oRPC v2: Call for Ideas, Features & Feedback #1293
Replies: 59 comments 123 replies
|
attaching errors to middleware please - if i have auth middleware that may throw a 403, using the middleware should attach that error. |
|
I'd like to be able to return a Response from a handler, making |
|
Stabilize ArkTypeToJsonSchemaConverter. |
|
Overall the thing is struggle most with are Typescript errors when I have lots of middlewares used in different combination. Not sure how it can be improved though. Would also be very nice to be able to define middlewares that transform regular output into eventIterator. So we can have a liveQuery middleware for example, that calls the handler when a Publisher emits something, and the handler is a regular function (not a generator). |
|
I know it’s complicated, but it would be amazing if OpenAPI output schema could be determined dynamically inferred on the return type of the handler |
|
Its a small thing. But I think this const server = createServer(async (req, res) => {
const result = await handler.handle(req, res, {
...options
})
if (!result.matched) {
res.statusCode = 404
res.end()
}
})could be simplified to this because the 404 part is probably the same for everyone. So the only reason we need code within the req-res-callback is to set options for the handler - which could also be set on the server. Less code means its more easy to understand and easier for newcomers. |
|
codegen. types generation to use in frontend props. |
|
Easy integration with message brokers such as Nats.io, RabbitMQ, etc. For now, I have implemented a custom Link/Handler for Nats.io, but it's a bit tricky with ServerPeer to transfer native messages. |
|
Documented support for tanstack AI. |
|
nice-grpc has a great feature that you can set retries and timeouts on the client and the rpc call. Setting defaults on the client is a nice feature as you don't have to remember to do it on every invocation. const client = createORPCClient(new OpenAPILink(contract, { url: '...' }, {
retries: {
planet: {
list: 3,
find: 3,
create: 1,
}
},
timeouts: {
planet: {
list: 1_000,
find: 1_000,
create: 5_000,
}
},
});This could use the contract and ensure you're only setting retries/timeouts for registered rpc calls. |
|
been trying to combine vercel resumable-stream with oRPC 👀 |
|
It would be great to have explicit separation between queries and mutations in procedure definitions, similar to tRPC’s approach. Currently, the inferred oRPC client doesn’t distinguish between query and mutation procedures, which means queries could be exported as mutations and vice versa.
I feel that the current recommandation with a filter on keywords in the client definition isn't ideal |
|
First-class support for usage without the server part, clearly described in docs. Including request and response validation on the client :) I think you kinda can do that now already? But that's my use case as I want to migrate away from dead zodios. |
|
be able to easily generate a client for external consumption without depending on anything from the server (maybe this already exists and i don't know about it ?). e.g., my |
|
Maybe a logger plugin, which can also be used in serverless environments like cf workers. As far as I know, the current "Pino Integration" doesn't work for Cloudflare Workers. |
|
I'm not sure whether this is already possible (at least its not mentioned anywhere) but for ORPC v2 it would be cool to have a possibility to disable validation in favor of performance in production without disabling transformations of e.g. dates. |
|
Support for the Temporal API for date, datetime and duration would be great in v2 :) |
|
It would be great to have a built‑in RPC playground, independent of OpenAPI—similar to GraphiQL, but for RPC. We could explore and invoke procedures directly in the browser, with inputs, outputs, and auto‑complete, all driven by the oRPC contract. No OpenAPI generation, Postman, or external tools are required. |
|
I guess the main one for me at the moment as I'm migrating to Effect, is defining the key points where oRPC holds an advantage over Effect's primitives for networking, errors, and typing. I understand there's so many useful features in oRPC, but there's also so much overlap that it's hard to justify using both. For those of us using Effect:
I'm not that deep into the migration yet, but because there's so much overlap, I'm wondering if you would still recommend oRPC over Effect RPC/HTTP, Schema, etc. Would love to hear your detailed perspective here. Thank you! |
|
Static file server helper function. Something like: os.handler(fileServerHandler('./public'))Hono has similart helper function |
|
One niche utility that would be nice is a helper to create these generic client-side proxies like the one returned by createTanstackQueryUtils. Would be helpful for custom TanStack Db integration, but could be used for more than that. |
|
Client links should also accept relative paths instead of full URL. Different hosts can call the API and I want the keep the original host. const link = new OpenAPILink(contract, {
url: `/api`,
}); |
|
OpenAPI 3.2 support? Finally we have nested tags in 3.2. |
|
Support for describing parameters in cookies. I created dedicated MR for v1: #1582 |
|
One improvement which could be introduced in const updatePlanet = os
.meta(openapi({
method: 'POST',
path: '/planets/{id}',
inputStructure: 'detailed',
}))
// input is a raw object instead of z.object({})
.input({
params: z.object({ id: z.string() }),
query: z.object({ dryRun: z.coerce.boolean().optional() }).optional(),
headers: z.object({ 'x-trace-id': z.string() }).optional(),
body: z.object({ name: z.string() }),
});With that, the |
|
🎂 It's my birthday today, and I have a gift for you: oRPC v2 is now in open beta 🚀 https://v2.orpc.dev/ |
|
Proposal: server-initiated RPC over WebSocket in v2 (a callable client router) To be precise up front: oRPC's WS is already full-duplex for data flow — within a client-initiated call the server streams back fine (event iterators, octet streams). The gap is server-originated requests: the server cannot start a new typed call to a specific connected client, because there's no client-hosted router for it to target. This is baked into the v2 peer protocol: Since v2 is already reworking the WS layer (lazy mode, reconnection, Proposal — let the client expose a router the server can call:
// client — declare what the server may call on us
const link = new RPCLink({ websocket, router: clientRouter })
// server — initiate a typed call to a specific connection
handler.onConnection(async (conn) => {
await conn.client.toast({ message: "saved" }) // typed against clientRouter
})Notes
|
|
I understand there are technical reasons for replacing Perhaps it would be an option to add shortcuts for the standard behavior as implemented in v1, at least for the OpenAPI/route definition? Thanks for your commitment to this great library! |
|
I have another Next.js related wish list item for better integrating with partial pre-rendering and the errors thrown during that process:
Two things I noticed digging into it: 1. The safe client has no framework awareness at all — 2. That
Plus it recurses into Would it make sense for the safe client (ideally every catch site) to be able to re-throw these? I don't want to prescribe an API — you know oRPC's direction far better — but the one property I'd hope for is that it stays framework-agnostic: something like a host-supplied For now I'm working around it by wrapping the safe client in a Proxy that runs |
Proposal: official MSW integration (
|
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone! 👋
We are starting to plan the next major version of oRPC (v2), and we want to build it with your input.
We aim to refine the DX, improve performance, and address architectural limitations. We need to know:
Please drop a comment below with your thoughts, code snippets, or just a +1 on ideas you like. Let's make v2 amazing! 🚀
All reactions