Skip to content

docs: Migrating from tRPC#936

Merged
dinwwwh merged 4 commits intomainfrom
docs/trpc-to-orpc-migration
Aug 26, 2025
Merged

docs: Migrating from tRPC#936
dinwwwh merged 4 commits intomainfrom
docs/trpc-to-orpc-migration

Conversation

@dinwwwh
Copy link
Copy Markdown
Member

@dinwwwh dinwwwh commented Aug 26, 2025

Closes: https://github.com/unnoq/orpc/issues/935

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive "Migrating from tRPC" guide with side-by-side comparisons, step-by-step migration instructions, examples, and integration notes.
    • Added a collapsed "Migrations" sidebar group under Docs to surface the new guide.
    • Updated numerous docs to replace Deno "install" snippets with "add" for npm-based dependency examples.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 26, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Warning

Rate limit exceeded

@unnoq has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 24 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 531b52c and cca22e4.

📒 Files selected for processing (1)
  • apps/content/docs/openapi/getting-started.md (1 hunks)

Walkthrough

Adds a new “Migrations” group to the VitePress docs sidebar and introduces a documentation page from-trpc that documents migrating from tRPC to oRPC. In addition, multiple docs updated to replace Deno deno install snippets with deno add.

Changes

Cohort / File(s) Summary
VitePress sidebar config
apps/content/.vitepress/config.ts
Inserts a collapsed “Migrations” group under the /docs/ sidebar with an item linking to /docs/migrations/from-trpc, placed after “Advanced” and before “Others”.
Docs: Migration guide
apps/content/docs/migrations/from-trpc.md
Adds a complete tRPC → oRPC migration guide with concept comparisons, step-by-step migration steps, and code examples (server, client, procedures, error handling, TanStack Query).
Deno snippet fixes (many docs)
apps/content/docs/** (examples: client/client-side.md, contract-first/*.md, getting-started.md, integrations/*, openapi/**, server-action.md)
Replaced Deno CLI snippets using deno install npm:... with deno add npm:... across multiple documentation pages to recommend adding npm dependencies rather than installing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Provide a detailed migration guide from tRPC to oRPC [#935]
Add the migration guide to the docs navigation/sidebar [#935]

Possibly related PRs

  • unnoq/orpc#855 — Also edits apps/content/.vitepress/config.ts sidebar entries (related sidebar changes).
  • unnoq/orpc#808 — Modifies apps/content/docs/openapi/integrations/trpc.md (overlaps same doc).
  • unnoq/orpc#593 — Modifies apps/content/docs/integrations/hey-api.md (same doc edited here for Deno snippet).

Suggested labels

size:L

Poem

I hop through docs with gentle cheer,
From tRPC burrows to oRPC clear.
Steps and handlers, examples bright,
Sidebar set — migrate tonight! 🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/trpc-to-orpc-migration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@vercel
Copy link
Copy Markdown

vercel bot commented Aug 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
orpc Ready Ready Preview Comment Aug 26, 2025 7:35am

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 26, 2025
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @unnoq, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new documentation page that serves as a comprehensive guide for migrating applications from tRPC to oRPC. The primary goal is to simplify the transition for developers by outlining conceptual differences and providing practical, step-by-step instructions with code examples. This change enhances the documentation's utility by offering clear pathways for users adopting oRPC from a similar ecosystem.

Highlights

  • New Migration Guide: A new documentation page has been added to guide users through the process of migrating their existing tRPC applications to oRPC. This comprehensive guide covers various aspects of the migration, from core concept comparisons to specific code changes.
  • Navigation Update: The site's navigation has been updated to include a dedicated 'Migrations' section, making the new 'Migrating from tRPC' guide easily discoverable for users looking to transition their projects.
  • Detailed Migration Steps and Code Examples: The migration guide provides detailed step-by-step instructions and side-by-side code examples for key areas such as package installation, initialization, defining procedures, structuring the app router, handling errors, and setting up both server and client-side integrations, including TanStack Query.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable documentation page for migrating from tRPC to oRPC. The guide is well-structured and provides a clear, step-by-step comparison. I've identified a couple of minor inconsistencies in the code examples for the server setup, which could lead to confusion. My feedback includes suggestions to correct these examples to improve accuracy and clarity for developers following the guide.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Aug 26, 2025

More templates

@orpc/arktype

npm i https://pkg.pr.new/@orpc/arktype@936

@orpc/client

npm i https://pkg.pr.new/@orpc/client@936

@orpc/contract

npm i https://pkg.pr.new/@orpc/contract@936

@orpc/experimental-durable-event-iterator

npm i https://pkg.pr.new/@orpc/experimental-durable-event-iterator@936

@orpc/hey-api

npm i https://pkg.pr.new/@orpc/hey-api@936

@orpc/interop

npm i https://pkg.pr.new/@orpc/interop@936

@orpc/json-schema

npm i https://pkg.pr.new/@orpc/json-schema@936

@orpc/nest

npm i https://pkg.pr.new/@orpc/nest@936

@orpc/openapi

npm i https://pkg.pr.new/@orpc/openapi@936

@orpc/openapi-client

npm i https://pkg.pr.new/@orpc/openapi-client@936

@orpc/otel

npm i https://pkg.pr.new/@orpc/otel@936

@orpc/react

npm i https://pkg.pr.new/@orpc/react@936

@orpc/react-query

npm i https://pkg.pr.new/@orpc/react-query@936

@orpc/experimental-react-swr

npm i https://pkg.pr.new/@orpc/experimental-react-swr@936

@orpc/server

npm i https://pkg.pr.new/@orpc/server@936

@orpc/shared

npm i https://pkg.pr.new/@orpc/shared@936

@orpc/solid-query

npm i https://pkg.pr.new/@orpc/solid-query@936

@orpc/standard-server

npm i https://pkg.pr.new/@orpc/standard-server@936

@orpc/standard-server-aws-lambda

npm i https://pkg.pr.new/@orpc/standard-server-aws-lambda@936

@orpc/standard-server-fetch

npm i https://pkg.pr.new/@orpc/standard-server-fetch@936

@orpc/standard-server-node

npm i https://pkg.pr.new/@orpc/standard-server-node@936

@orpc/standard-server-peer

npm i https://pkg.pr.new/@orpc/standard-server-peer@936

@orpc/svelte-query

npm i https://pkg.pr.new/@orpc/svelte-query@936

@orpc/tanstack-query

npm i https://pkg.pr.new/@orpc/tanstack-query@936

@orpc/trpc

npm i https://pkg.pr.new/@orpc/trpc@936

@orpc/valibot

npm i https://pkg.pr.new/@orpc/valibot@936

@orpc/vue-colada

npm i https://pkg.pr.new/@orpc/vue-colada@936

@orpc/vue-query

npm i https://pkg.pr.new/@orpc/vue-query@936

@orpc/zod

npm i https://pkg.pr.new/@orpc/zod@936

commit: cca22e4

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (7)
apps/content/docs/migrations/from-trpc.md (7)

238-239: Grammar fix.

“plain objects is enough” → “plain objects are enough.”

-The main router structure is similar between tRPC and oRPC, except in oRPC you don't need to wrap routers in a `.router` call - plain objects is enough.
+The main router structure is similar between tRPC and oRPC, except in oRPC you don't need to wrap routers in a `.router` call — plain objects are enough.

172-199: Add missing zod import in the oRPC router example.

z is used but never imported in the snippet. Add it for completeness.

 ```ts [orpc/routers/planet.ts]
+import { z } from 'zod'
 export const planetRouter = {
   list: publicProcedure

354-368: Type-only import to avoid bundling server package on the client.

The type RouterClient comes from @orpc/server. Using a value import can cause accidental bundling in some setups. Use a type-only import.

-import { RouterClient } from '@orpc/server'
+import type { RouterClient } from '@orpc/server'

268-283: TRPCError options: verify whether data is a valid option.

tRPC’s TRPCError traditionally accepts { code, message?, cause? }. Passing data may be unsupported. Consider removing data or moving it under cause or your own error shape.

Proposed edit if data isn’t supported:

-throw new TRPCError({
-  code: 'BAD_REQUEST',
-  message: 'Invalid input',
-  data: 'some data',
-  cause: validationError
-})
+throw new TRPCError({
+  code: 'BAD_REQUEST',
+  message: 'Invalid input',
+  cause: validationError,
+})

If you intend to return additional metadata, document how oRPC handles data and how to mirror that in tRPC responses.


41-58: Package names: confirm tRPC React Query package naming.

Some projects use @trpc/react-query rather than @trpc/tanstack-react-query. To make the migration safer, consider adding both variants in uninstall commands or a note.

Example addition:

-npm uninstall @trpc/server @trpc/client @trpc/tanstack-react-query
+npm uninstall @trpc/server @trpc/client @trpc/tanstack-react-query @trpc/react-query

Repeat similarly for yarn/pnpm/bun/deno.


423-441: tRPC TanStack Query API shape: verify createTRPCContext import and hooks.

tRPC’s canonical React adapter has historically exposed createTRPCReact from @trpc/react-query, returning a trpc helper object rather than { TRPCProvider, useTRPC }. If you’re targeting a newer or experimental API (@trpc/tanstack-react-query), please verify names and usage to avoid confusing readers.

If sticking to the widely-used API, consider this alternative:

- import { createTRPCContext } from '@trpc/tanstack-react-query'
- export const { TRPCProvider, useTRPC, useTRPCClient } = createTRPCContext<typeof appRouter>()
+ import { createTRPCReact } from '@trpc/react-query'
+ export const trpc = createTRPCReact<typeof appRouter>()

Then usage typically becomes:

// Provider:
// <trpc.Provider client={client} queryClient={queryClient}>{children}</trpc.Provider>

// Query:
const planets = trpc.planet.list.useQuery({ cursor: 0 })

If you intend to demonstrate the newer “queryOptions” helpers, keep them but ensure the package and API names are accurate and consistent with the version you support.


10-12: Cross-link is solid; consider an extra nudge to relevant OpenAPI guide.

The info box already links to the tRPC integration. Optionally, add a note that users can mix OpenAPI and oRPC if they’re not ready to migrate entirely.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e4e9820 and 27745b6.

📒 Files selected for processing (2)
  • apps/content/.vitepress/config.ts (1 hunks)
  • apps/content/docs/migrations/from-trpc.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
apps/content/docs/migrations/from-trpc.md

[grammar] ~28-~28: There might be a mistake here.
Context: ... | built-in | ::: info Learn more about [oRPC vs tRPC Compariso...

(QB_NEW_EN)


[grammar] ~162-~162: There might be a mistake here.
Context: ... }, }) }) ``` ::: ::: info Learn more about oRPC [Context](/docs/co...

(QB_NEW_EN)


[grammar] ~163-~163: There might be a mistake here.
Context: ...xt), and Middleware. ::: ### 3. Procedures In oRPC, there a...

(QB_NEW_EN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: lint
  • GitHub Check: publish-commit
🔇 Additional comments (1)
apps/content/.vitepress/config.ts (1)

223-229: LGTM: Sidebar “Migrations” group is correctly wired.

The new group is placed logically (after Advanced, before Others), is collapsed by default, and the link path matches the new page at /docs/migrations/from-trpc.

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

♻️ Duplicate comments (4)
apps/content/docs/migrations/from-trpc.md (4)

232-234: Link text consistency: singular “Procedure”.

The path is singular /docs/procedure but the anchor text is plural.

-Learn more about oRPC [Procedures](/docs/procedure).
+Learn more about oRPC [Procedure](/docs/procedure).

60-63: Deno: use deno add (not deno install) for dependencies.

deno install installs executables; it won’t add npm packages to your project. Use deno add instead.

 ```sh [deno]
 deno remove npm:@trpc/server npm:@trpc/client npm:@trpc/tanstack-react-query
-deno install npm:@orpc/server@latest npm:@orpc/client@latest npm:@orpc/tanstack-query@latest
+deno add npm:@orpc/server@latest npm:@orpc/client@latest npm:@orpc/tanstack-query@latest

---

`314-321`: **Fix context factory name and argument shape in oRPC Next.js handler.**

Earlier you defined `createRPCContext(opts: { headers: Headers })`. Here it calls a non‑existent `createORPCContext` and passes the full Request. Pass `{ headers: request.headers }` to `createRPCContext`.



```diff
 async function handleRequest(request: Request) {
   const { response } = await handler.handle(request, {
     prefix: '/api/orpc',
-    context: await createORPCContext(request)
+    context: await createRPCContext({ headers: request.headers })
   })

335-345: Align tRPC context factory name and argument shape.

Use the same createRPCContext({ headers: req.headers }) you introduced earlier.

     router: appRouter,
-    createContext: () => createTRPCContext(req),
+    createContext: () => createRPCContext({ headers: req.headers }),
🧹 Nitpick comments (3)
apps/content/docs/migrations/from-trpc.md (3)

238-239: Grammar: plural subject agreement.

“plain objects is enough” → “plain objects are enough.”

-The main router structure is similar between tRPC and oRPC, except in oRPC you don't need to wrap routers in a `.router` call - plain objects is enough.
+The main router structure is similar between tRPC and oRPC, except in oRPC you don't need to wrap routers in a `.router` call — plain objects are enough.

28-30: Punctuation: end the info sentence with a period.

Minor polish for readability.

-Learn more about [oRPC vs tRPC Comparison](/docs/comparison)
+Learn more about [oRPC vs tRPC Comparison](/docs/comparison).

162-164: Punctuation: unnecessary comma before “and”.

Tiny style tweak in the info line.

-Learn more about oRPC [Context](/docs/context), and [Middleware](/docs/middleware).
+Learn more about oRPC [Context](/docs/context) and [Middleware](/docs/middleware).
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 27745b6 and 3b241e0.

📒 Files selected for processing (1)
  • apps/content/docs/migrations/from-trpc.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
apps/content/docs/migrations/from-trpc.md

[grammar] ~28-~28: There might be a mistake here.
Context: ... | built-in | ::: info Learn more about [oRPC vs tRPC Compariso...

(QB_NEW_EN)


[grammar] ~162-~162: There might be a mistake here.
Context: ... }, }) }) ``` ::: ::: info Learn more about oRPC [Context](/docs/co...

(QB_NEW_EN)


[grammar] ~163-~163: There might be a mistake here.
Context: ...xt), and Middleware. ::: ### 3. Procedures In oRPC, there a...

(QB_NEW_EN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: publish-commit
  • GitHub Check: lint
🔇 Additional comments (2)
apps/content/docs/migrations/from-trpc.md (2)

392-394: Cross-check these doc links exist.

Please verify these three routes are live and correct in your site config: /docs/client/client-side, /docs/plugins/batch-requests, /docs/plugins/dedupe-requests.


422-426: tRPC TanStack package and API names may be outdated.

Recent tRPC versions have used @trpc/react-query with createTRPCReact. If you intend to reference @trpc/tanstack-react-query and createTRPCContext, confirm the exact package and API names for the targeted tRPC version to prevent copy-paste errors.

Would you like me to run a quick check against the latest tRPC docs and adjust this snippet accordingly?

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Aug 26, 2025
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

♻️ Duplicate comments (5)
apps/content/docs/migrations/from-trpc.md (5)

232-234: Link text: align with singular route

The route is singular (/docs/procedure); adjust anchor text to match.

-Learn more about oRPC [Procedures](/docs/procedure).
+Learn more about oRPC [Procedure](/docs/procedure).

314-318: Fix context factory name and argument shape in oRPC Next.js handler

Earlier, you defined createRPCContext(opts: { headers: Headers }). Here it calls a non‑existent createORPCContext and passes the wrong shape. Pass { headers: request.headers } to createRPCContext.

   const { response } = await handler.handle(request, {
     prefix: '/api/orpc',
-    context: await createORPCContext(request)
+    context: await createRPCContext({ headers: request.headers })
   })

330-336: Align tRPC context factory name and args with earlier snippet

You exported createRPCContext in trpc/base.ts. Use the same name here and pass headers, not the whole req.

-    createContext: () => createTRPCContext(req),
+    createContext: () => createRPCContext({ headers: req.headers }),

402-420: TanStack Query (oRPC) snippet: missing React Query hooks and client import

useQuery, useInfiniteQuery, and useMutation are used but not imported; client is referenced but not imported either.

 ```ts [orpc/tanstack-query.ts]
 import { createTanstackQueryUtils } from '@orpc/tanstack-query'
+import { useQuery, useInfiniteQuery, useMutation } from '@tanstack/react-query'
+import { client } from '@/orpc/client' // adjust path

353-372: Client typing pulls server value on the client and references an undefined symbol

RouterClient<typeof appRouter> requires a value import of appRouter (server code) and appRouter isn’t in scope. Prefer a type‑only import of AppRouter exported from the server router example.

 import { createORPCClient, onError } from '@orpc/client'
 import { RPCLink } from '@orpc/client/fetch'
-import { RouterClient } from '@orpc/server'
+import { RouterClient } from '@orpc/server'
+import type { AppRouter } from '@/orpc/router' // adjust path
 
@@
-export const client: RouterClient<typeof appRouter> = createORPCClient(link)
+export const client: RouterClient<AppRouter> = createORPCClient(link)
🧹 Nitpick comments (11)
apps/content/docs/integrations/tanstack-query-old/svelte.md (1)

31-31: Consider specifying minimum Deno version support and pinning major versions

A few tweaks to improve stability and clarity:

  • Add a brief inline note or admonition about the minimum Deno release that supports deno add (and, if you still target older releases, offer an alternative invocation).
  • Pin to major versions rather than using @latest to avoid unexpected breaking changes as new majors are released. For example, switch to @5 for TanStack Query and align the corresponding ORPC package’s major.

Suggested update:

- deno add npm:@orpc/svelte-query@latest npm:@tanstack/svelte-query@latest
+ # Requires Deno 1.34+ (supports `deno add`); for older versions, use the manual install fallback below
+ deno add npm:@orpc/svelte-query@5 npm:@tanstack/svelte-query@5
apps/content/docs/integrations/tanstack-query-old/react.md (1)

31-31: No lingering deno install npm: references found

  • A repository-wide scan returned zero occurrences of deno install npm:—no further cleanup needed there.
  • You may still opt to add a compatibility note and pin major versions in the Deno snippet within
    apps/content/docs/integrations/tanstack-query-old/react.md, e.g.:
    - deno add npm:@orpc/react-query@latest npm:@tanstack/react-query@latest
    + # Requires Deno 1.34+ for `deno add`
    + deno add npm:@orpc/react-query@latest npm:@tanstack/react-query@5
  • No other action is required unless you want to adopt the optional refactoring above.
apps/content/docs/openapi/plugins/zod-smart-coercion.md (2)

44-47: Avoid duplicate identifier in example imports

The two imports both bind ZodSmartCoercionPlugin in the same scope, which would be a TS error if copied verbatim. Consider splitting into two separate code blocks (one for Zod v3, one for Zod v4) or comment one out to prevent copy‑paste confusion.

Apply either of the following minimal tweaks:

Option A — split into two blocks (preferred for clarity):

-import { ZodSmartCoercionPlugin } from '@orpc/zod' // <-- zod v3
-import {
-  experimental_ZodSmartCoercionPlugin as ZodSmartCoercionPlugin
-} from '@orpc/zod/zod4' // <-- zod v4
+// Zod v3
+import { ZodSmartCoercionPlugin } from '@orpc/zod'
+// Zod v4
+import {
+  experimental_ZodSmartCoercionPlugin as ZodSmartCoercionPlugin
+} from '@orpc/zod/zod4'

Option B — keep one and comment the other:

-import { ZodSmartCoercionPlugin } from '@orpc/zod' // <-- zod v3
+import { ZodSmartCoercionPlugin } from '@orpc/zod' // <-- zod v3
+// For Zod v4 use:
+// import { experimental_ZodSmartCoercionPlugin as ZodSmartCoercionPlugin } from '@orpc/zod/zod4'

54-56: Consistent admonition syntax

Elsewhere you use “::: warning” with a space. Here it’s “:::warning”. For consistency (and to match VitePress docs), add the space.

-:::warning
+::: warning
apps/content/docs/openapi/client/openapi-link.md (4)

73-76: Admonition spacing

Use “::: warning” (with a space) for consistency with other pages and VitePress examples.

-:::warning
+::: warning

84-86: Clarify sentence about string conversion

Small grammar/clarity improvement.

-In these cases, both the request and response are subject to the limitations of [Bracket Notation Limitations](/docs/openapi/bracket-notation#limitations). Additionally, oRPC converts data to strings (exclude `null` and `undefined` will not be represented).
+In these cases, both the request and response are subject to the [Bracket Notation limitations](/docs/openapi/bracket-notation#limitations). Additionally, oRPC converts data to strings (excluding `null` and `undefined`, which are not represented).

90-96: Fix typos and MIME type

Minor wording fixes: “when the file …” and correct MIME “text/plain”.

-`OpenAPILink` requires access to the `Content-Disposition` to distinguish file responses from other responses whe file has a common MIME type like `application/json`, `plain/text`, etc. To enable this, include `Content-Disposition` in your CORS policy's `Access-Control-Expose-Headers`:
+`OpenAPILink` requires access to the `Content-Disposition` header to distinguish file responses from other responses when the file has a common MIME type like `application/json`, `text/plain`, etc. To enable this, include `Content-Disposition` in your CORS policy's `Access-Control-Expose-Headers`:

159-163: Admonition spacing (again)

Same consistency nit as above: add a space after the colons.

-:::warning
+::: warning
apps/content/docs/migrations/from-trpc.md (3)

238-239: Grammar nit: plural agreement and dash style

“plain objects is enough” → “plain objects are enough” (and an em dash reads better here).

-The main router structure is similar between tRPC and oRPC, except in oRPC you don't need to wrap routers in a `.router` call - plain objects is enough.
+The main router structure is similar between tRPC and oRPC, except in oRPC you don't need to wrap routers in a `.router` call — plain objects are enough.

242-248: Export AppRouter type for client usage

Exporting the router type simplifies client typing without value‑side imports.

 export const appRouter = {
   planet: planetRouter,
 }
+
+export type AppRouter = typeof appRouter

422-426: tRPC React bindings: verify package and API names

Most tRPC React examples use createTRPCReact from @trpc/react-query, not createTRPCContext from @trpc/tanstack-react-query. If you target the official bindings, consider updating the import and usage accordingly. Please confirm against current tRPC docs, as package names/APIs may have changed recently.

-```ts [trpc/tanstack-query.ts]
-import { createTRPCContext } from '@trpc/tanstack-react-query'
-
-export const { TRPCProvider, useTRPC, useTRPCClient } = createTRPCContext<typeof appRouter>()
+```ts [trpc/tanstack-query.ts]
+import { createTRPCReact } from '@trpc/react-query'
+
+export const trpc = createTRPCReact<typeof appRouter>()
+// Usage in app root:
+// <trpc.Provider client={client} queryClient={queryClient}>{children}</trpc.Provider>
+// In components:
+// const utils = trpc.useUtils()
+// const query = trpc.planet.list.useQuery({ cursor: 0 })

Would you like me to adjust all tRPC snippets to this style if confirmed?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3b241e0 and 531b52c.

📒 Files selected for processing (25)
  • apps/content/docs/client/client-side.md (1 hunks)
  • apps/content/docs/contract-first/define-contract.md (1 hunks)
  • apps/content/docs/contract-first/implement-contract.md (1 hunks)
  • apps/content/docs/getting-started.md (1 hunks)
  • apps/content/docs/integrations/durable-event-iterator.md (1 hunks)
  • apps/content/docs/integrations/hey-api.md (1 hunks)
  • apps/content/docs/integrations/opentelemetry.md (1 hunks)
  • apps/content/docs/integrations/pinia-colada.md (1 hunks)
  • apps/content/docs/integrations/react-swr.md (1 hunks)
  • apps/content/docs/integrations/sentry.md (1 hunks)
  • apps/content/docs/integrations/tanstack-query-old/react.md (1 hunks)
  • apps/content/docs/integrations/tanstack-query-old/solid.md (1 hunks)
  • apps/content/docs/integrations/tanstack-query-old/svelte.md (1 hunks)
  • apps/content/docs/integrations/tanstack-query-old/vue.md (1 hunks)
  • apps/content/docs/integrations/tanstack-query.md (1 hunks)
  • apps/content/docs/migrations/from-trpc.md (1 hunks)
  • apps/content/docs/openapi/client/openapi-link.md (1 hunks)
  • apps/content/docs/openapi/getting-started.md (1 hunks)
  • apps/content/docs/openapi/integrations/implement-contract-in-nest.md (1 hunks)
  • apps/content/docs/openapi/integrations/trpc.md (1 hunks)
  • apps/content/docs/openapi/openapi-handler.md (1 hunks)
  • apps/content/docs/openapi/openapi-specification.md (1 hunks)
  • apps/content/docs/openapi/plugins/smart-coercion.md (1 hunks)
  • apps/content/docs/openapi/plugins/zod-smart-coercion.md (1 hunks)
  • apps/content/docs/server-action.md (1 hunks)
✅ Files skipped from review due to trivial changes (12)
  • apps/content/docs/integrations/pinia-colada.md
  • apps/content/docs/openapi/openapi-specification.md
  • apps/content/docs/integrations/tanstack-query.md
  • apps/content/docs/integrations/react-swr.md
  • apps/content/docs/openapi/integrations/trpc.md
  • apps/content/docs/integrations/tanstack-query-old/vue.md
  • apps/content/docs/integrations/tanstack-query-old/solid.md
  • apps/content/docs/client/client-side.md
  • apps/content/docs/integrations/durable-event-iterator.md
  • apps/content/docs/contract-first/define-contract.md
  • apps/content/docs/integrations/hey-api.md
  • apps/content/docs/openapi/plugins/smart-coercion.md
🧰 Additional context used
🪛 LanguageTool
apps/content/docs/migrations/from-trpc.md

[grammar] ~28-~28: There might be a mistake here.
Context: ... | built-in | ::: info Learn more about [oRPC vs tRPC Compariso...

(QB_NEW_EN)


[grammar] ~162-~162: There might be a mistake here.
Context: ... }, }) }) ``` ::: ::: info Learn more about oRPC [Context](/docs/co...

(QB_NEW_EN)


[grammar] ~163-~163: There might be a mistake here.
Context: ...xt), and Middleware. ::: ### 3. Procedures In oRPC, there a...

(QB_NEW_EN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: lint
  • GitHub Check: publish-commit
🔇 Additional comments (13)
apps/content/docs/integrations/tanstack-query-old/svelte.md (1)

30-32: Good change: use deno add instead of deno install for dependencies

Using deno add is the correct guidance for adding npm dependencies; deno install is for installing executable scripts. This prevents users from mistakenly installing a CLI instead of adding library deps.

apps/content/docs/integrations/tanstack-query-old/react.md (1)

30-32: Correct dependency guidance for Deno

Switching to deno add is accurate for adding npm dependencies in Deno projects and avoids confusion with deno install (which installs executables).

apps/content/docs/contract-first/implement-contract.md (1)

30-32: No leftover deno install npm:@orpc/... usages found

– Ran a repository-wide grep over apps/content/docs/*.md for any deno install npm:@orpc/ references; no matches were found.
– All documentation now consistently uses deno add npm:@orpc/server@latest for installing the package.

apps/content/docs/openapi/integrations/implement-contract-in-nest.md (1)

34-36: Deno command fix looks good.

Replacing deno install with deno add for @orpc/nest is consistent with current Deno guidance.

apps/content/docs/integrations/opentelemetry.md (1)

40-42: LGTM: deno add for @orpc/otel.

Matches the project-wide convention and avoids the legacy install usage.

apps/content/docs/openapi/openapi-handler.md (1)

59-61: LGTM: Updated Deno install snippet.

deno add npm:@orpc/openapi@latest is the right command for adding the dependency.

apps/content/docs/integrations/sentry.md (1)

38-40: LGTM: Consistent with other Deno sections.

The switch to deno add npm:@orpc/otel@latest brings this page in line with the other updated docs.

apps/content/docs/openapi/plugins/zod-smart-coercion.md (1)

34-36: Switch to deno add is correct

Using deno add for npm specifiers is the right command for Deno’s package management. No further action needed here.

apps/content/docs/server-action.md (1)

127-129: Switch to deno add looks good

Using deno add npm:@orpc/react@latest aligns with the rest of the docs changes.

apps/content/docs/getting-started.md (1)

40-42: Correct Deno install command

The update to deno add with npm: specifiers is correct for Deno. Thanks for keeping this consistent across docs.

apps/content/docs/openapi/client/openapi-link.md (1)

30-32: Deno instruction updated correctly

deno add npm:@orpc/openapi-client@latest is the correct command. No issues here.

apps/content/docs/migrations/from-trpc.md (2)

1-13: Solid addition: clear intro and cross-link to comparison/integration docs

Opening, front‑matter, and the “quick enhancement” callout are clear and helpful. No issues here.


40-63: Verify tRPC React Query integration package name
The guide currently uninstalls @trpc/tanstack-react-query. Please confirm that for the version of tRPC you’re targeting this is indeed the correct React Query bindings package (instead of @trpc/react-query with createTRPCReact), so readers don’t end up following outdated commands.

• File: apps/content/docs/migrations/from-trpc.md
• Lines: 40–63 (Installation step)

@dinwwwh dinwwwh merged commit 150aa84 into main Aug 26, 2025
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tRPC -> oRPC migration

1 participant