Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/content/blume.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,14 @@ export default defineConfig({
{ from: '/docs/plugins/body-compression', to: '/docs/plugins/response-compression' },
{ from: '/docs/openapi/plugins/openapi-reference', to: '/docs/plugins/openapi-reference' },
{ from: '/docs/openapi/plugins/smart-coercion', to: '/docs/plugins/smart-coercion' },
{ from: '/docs/openapi/plugins/zod-smart-coercion', to: '/docs/plugins/smart-coercion' },
{ from: '/docs/plugins/hibernation', to: '/docs/integrations/hibernation' },

{ from: '/docs/integrations/react-swr', to: '/docs/integrations/swr' },
{ from: '/docs/openapi/integrations/implement-contract-in-nest', to: '/docs/integrations/nest' },
{ from: '/docs/openapi/integrations/trpc', to: '/docs/integrations/trpc' },
{ from: '/docs/server-action', to: '/docs/integrations/next' },
{ from: '/docs/integrations/tanstack-query-old/:slug*', to: '/docs/integrations/tanstack-query' },
],
export: true,
integrations: [
Expand Down
12 changes: 7 additions & 5 deletions apps/content/docs/comparison.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ oRPC, [tRPC](https://trpc.io/), and [Hono](https://hono.dev/) all deliver end-to
- 🟑 Lacks features or requires third-party integrations
- πŸ›‘ Not supported or not documented

Checked against tRPC 11.19 and Hono 4.13 (October 2026).

### Type Safety

| Feature | oRPC | tRPC | Hono |
Expand All @@ -25,22 +27,22 @@ oRPC, [tRPC](https://trpc.io/), and [Hono](https://hono.dev/) all deliver end-to
| [End-to-end typesafe `ReadableStream<Uint8Array>`](/docs/binary-data#readablestreamuint8array) | βœ… | πŸ›‘ | πŸ›‘ |
| [Typesafe at scale](#type-checking-performance) | βœ… | βœ… | πŸ›‘ |

oRPC types errors per procedure or globally: throw a plain `ORPCError`, [declare errors](/docs/error-handling) on a single procedure or a shared builder, or define them once and reuse them everywhere via an [error factory](/docs/error-handling#error-factory). tRPC exposes one global error shape, and Hono only types errors returned with an explicit status code. oRPC is also the only one that types binary data in both directions: tRPC and Hono cover uploads but not typed binary responses.
oRPC types errors per procedure or globally: throw a plain `ORPCError`, [declare errors](/docs/error-handling) on a single procedure or a shared builder, or define them once and reuse them everywhere via an [error factory](/docs/error-handling#error-factory). tRPC (as of 11.19) exposes one global error shape, and Hono only types errors returned with an explicit status code. oRPC is also the only one that types binary data in both directions: tRPC and Hono cover uploads but not typed binary responses.

### API Design & OpenAPI

| Feature | oRPC | tRPC | Hono |
| --- | --- | --- | --- |
| Implementation-first approach | βœ… | βœ… | βœ… |
| [Contract-first approach](/docs/contract-first) | βœ… | πŸ›‘ | βœ… |
| [OpenAPI spec generation](/docs/openapi/specification) | βœ… | 🟑 | βœ… |
| [Contract-first approach](/docs/contract-first) | βœ… | πŸ›‘ | 🟑 |
| [OpenAPI spec generation](/docs/openapi/specification) | βœ… | 🟑 | 🟑 |
| [Standard Schema (Zod, Valibot, ArkType, ...)](/docs/integrations/standard-schema) | βœ… | βœ… | 🟑 |
| [Native types (Date, URL, Set, Map, ...)](/docs/rpc/serializer#supported-data-types) | βœ… | 🟑 | πŸ›‘ |
| [Custom serializers](/docs/rpc/serializer#custom-serializers) | βœ… | βœ… | πŸ›‘ |
| [Bracket notation](/docs/openapi/bracket-notation) | βœ… | πŸ›‘ | πŸ›‘ |
| [Lazy router (code splitting, faster cold starts)](/docs/router#lazy-router) | βœ… | βœ… | πŸ›‘ |

oRPC serves the same procedures over its [RPC protocol](/docs/rpc/protocol) and RESTful [OpenAPI endpoints](/docs/openapi/handler) and generates the OpenAPI spec natively, while tRPC and Hono depend on extra packages for OpenAPI. Native types like `Date` or `Map` work out of the box in oRPC; tRPC needs a transformer, and Hono has no serialization layer: what you pass to `c.json()` is what you get.
oRPC serves the same procedures over its [RPC protocol](/docs/rpc/protocol) and RESTful [OpenAPI endpoints](/docs/openapi/handler), and generates the spec with a first-party package. tRPC's `@trpc/openapi` is alpha and covers only tRPC-style endpoints, and Hono relies on third-party middleware like `@hono/zod-openapi`. Native types like `Date` or `Map` work out of the box in oRPC; tRPC needs a transformer, and Hono has no serialization layer: what you pass to `c.json()` is what you get.

### Integrations & Ecosystem

Expand All @@ -60,7 +62,7 @@ oRPC serves the same procedures over its [RPC protocol](/docs/rpc/protocol) and
| [AI SDK integration](/docs/integrations/ai-sdk) | βœ… | πŸ›‘ | πŸ›‘ |
| [MCP integration (procedures as AI agent tools)](/docs/integrations/mcp) | βœ… | 🟑 | 🟑 |
| [Next.js Server Actions support](/docs/integrations/next) | βœ… | βœ… | πŸ›‘ |
| [Built-in plugins (CORS, CSRF, Retry, ...)](/docs/plugins/cors) | βœ… | πŸ›‘ | βœ… |
| [Built-in plugins (CORS, CSRF, Retry, ...)](/docs/plugins/cors) | βœ… | 🟑 | βœ… |
| [Built-in helpers (cookie, encryption, signing, ...)](/docs/helpers/cookie) | βœ… | πŸ›‘ | βœ… |
| [NestJS integration](/docs/integrations/nest) | βœ… | 🟑 | πŸ›‘ |
| [OpenTelemetry integration](/docs/integrations/opentelemetry) | βœ… | πŸ›‘ | 🟑 |
Expand Down
26 changes: 13 additions & 13 deletions apps/content/docs/migrations/from-trpc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ If you want to add oRPC features to an existing tRPC app without a full migratio

## Core Concepts Comparison

| Concept | tRPC | oRPC |
| --------------------- | ---------------------------- | ------------------- |
| **Router** | `t.router()` | plain object |
| **Procedure** | `t.procedure` | `os` |
| **Context** | `initTRPC.context<T>()` | `os.$context<T>()` |
| **Create Middleware** | `t.middleware()` | `os.middleware()` |
| **Use Middleware** | `t.procedure.use()` | `os.use()` |
| **Input Validation** | `t.procedure.input(schema)` | `os.input(schema)` |
| **Output Validation** | `t.procedure.output(schema)` | `os.output(schema)` |
| **Error Handling** | `TRPCError` | `ORPCError` |
| **Serializer** | `superjson` | built-in |
| Concept | tRPC | oRPC |
| --------------------- | -------------------------------- | ------------------- |
| **Router** | `t.router()` | plain object |
| **Procedure** | `t.procedure` | `os` |
| **Context** | `initTRPC.context<T>()` | `os.$context<T>()` |
| **Create Middleware** | `t.middleware()` | `os.middleware()` |
| **Use Middleware** | `t.procedure.use()` | `os.use()` |
| **Input Validation** | `t.procedure.input(schema)` | `os.input(schema)` |
| **Output Validation** | `t.procedure.output(schema)` | `os.output(schema)` |
| **Error Handling** | `TRPCError` | `ORPCError` |
| **Serializer** | `transformer` (e.g. `superjson`) | built-in |

:::info
See [oRPC vs tRPC Comparison](/docs/comparison) for a broader comparison.
Expand Down Expand Up @@ -291,7 +291,7 @@ This example uses [Next.js](https://nextjs.org/). If you use another framework,

<CodeGroup>

```ts app/api/orpc/[[...rest ]/route.ts]
```ts title="app/api/orpc/[[...rest]]/route.ts"
import { RPCHandler } from '@orpc/server/fetch'

const handler = new RPCHandler(appRouter, {
Expand Down Expand Up @@ -321,7 +321,7 @@ export const GET = handleRequest
export const POST = handleRequest
```

```ts app/api/trpc/[trpc /route.ts]
```ts title="app/api/trpc/[trpc]/route.ts"
import { fetchRequestHandler } from '@trpc/server/adapters/fetch'

function handler(req: Request) {
Expand Down
4 changes: 2 additions & 2 deletions apps/content/pages/_home/Comparison.astro
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ const rows = [
{
feature: 'Contract-first approach',
href: '/docs/contract/procedure',
support: ['full', 'none', 'full'],
support: ['full', 'none', 'partial'],
},
{
feature: 'OpenAPI spec generation',
href: '/docs/openapi/specification',
support: ['full', 'partial', 'full'],
support: ['full', 'partial', 'partial'],
},
{
// @orpc/tanstack-query returns options objects, not hooks, so it works with
Expand Down
Binary file added apps/content/public/logo.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading