Repository navigation
v2.0.0-beta.53
Pre-release
Pre-release
Tip
oRPC v2 is close to stable. If you’ve tried the beta, tell us what was hard to migrate, which changes surprised you, and what you still need before upgrading. Join the v2 discussion.
Highlights
This beta tightens the retry, error, and lock APIs ahead of v2 stable. It also lets you customize errors from built-in request guards and fixes intermittent lazy-router failures on Cloudflare Workers.
const retryAfter = new RetryAfterLinkPlugin({
shouldRetry: (response) => [429, 503].includes(response.status),
maxAttempts: 3, // Includes the first request
})- Breaking — retry and reconnect options. Rename
RetryAfterLinkPlugin’sconditiontoshouldRetry. For WebSocket reconnects, renamemaxAttempt,maxTotalAttempt, and the callback fieldtotalAttempttomaxAttempts,maxTotalAttempts, andtotalAttempts.RetryLinkPlugin’sretry: 3still allows three retries after the first request. #2525 - Breaking — error types.
ORPCError.codeandORPCError.dataare now readonly in TypeScript. Timeout plugins useTimeoutError, and WebSocket and MessagePort links reject withConnectionClosedErrorwhen the connection closes. Update any handlers that previously caught these cases asAbortError. #2523 · #2533 - Breaking — locks and Redis publishers. Pass an explicit
ttlin milliseconds toMemoryLocker. If you subclassBaseRedisPublisher, renameeventPrefixtokeyPrefixand remove references toxTrimExactness, which is now private. #2529 - Custom request refusal errors. The rate-limit and lock middleware, request-size and temporary-upload plugins, and GET CSRF protection accept an
erroroption. The client receives a defined error when its code and data match the procedure’s error contract. The temporary-upload plugin also now requiresmaxBodySize. #2514 · #2529 · #2543 - Cloudflare Workers. RPC, OpenAPI, and MCP handlers no longer share in-flight lazy-router loads across requests, so one request ending during a load can no longer stall later requests. Memory locks held by ended requests can also expire. #2535 · #2540
- Rate-limit headers and tRPC inputs.
ratelimit-resetnow reports seconds, and the tRPC adapter carries every chained input schema into the converted oRPC procedure. #2530 · #2542
🚨 Breaking Changes
- client: Unify retry and attempt option naming - by @dinwwwh in #2525 (f262f)
- client, contract, json-schema: Make ORPCError code and data readonly and fix the name brand - by @dinwwwh in #2523 (b5920)
- publisher, lock, bun: Align the Redis extension surface and lock options - by @dinwwwh in #2529 (742cd)
🚀 Features
- server, ratelimit, node: Allow custom errors for built-in request refusals - by @dinwwwh in #2514 (77da9)
🐞 Bug Fixes
- client:
- client, server, shared:
- lock:
- nest:
- node:
- ratelimit:
- server:
- Convert decode failures to BAD_REQUEST before interceptors see them - by @dinwwwh in #2517 (2d3fe)
- Align matched in WebSocket and crossws message() with MessagePort - by @dinwwwh in #2532 (7b0fd)
- Default method override param to _method and keep the query string intact - by @dinwwwh in #2541 (0027e)
- server, openapi, mcp:
- trpc: