Repository navigation
docs: update tRPC migration guide to tRPC v11 APIs - #2311
Conversation
- Use createTRPCClient instead of the deprecated createTRPCProxyClient - Pass the superjson transformer to httpLink, as v11 requires it on links - Drop the unsupported data option from the TRPCError example - List initTRPC.context<T>() for context in the concept table Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018GtLLKwPMbDUwRXzt74JyZ
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
orpc | eeda240 | Commit Preview URL Branch Preview URL |
Oct 23 2026, 02:49 AM |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This PR only updates a single migration-guide MDX file with tRPC v11 syntax and corrected examples. It does not modify runtime code or production configuration, so its repository blast radius is limited to documentation. You can add or adjust custom eligibility rules. Learn more. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
More templates
@orpc/ai-sdk
@orpc/arktype
@orpc/bun
@orpc/client
@orpc/cloudflare
@orpc/contract
@orpc/experimental-effect
@orpc/evlog
@orpc/hibernation
@orpc/json-schema
@orpc/experimental-lock
@orpc/mcp
@orpc/msw
@orpc/nest
@orpc/next
@orpc/node
@orpc/openapi
@orpc/opentelemetry
@orpc/pinia-colada
@orpc/pino
@orpc/publisher
@orpc/ratelimit
@orpc/server
@orpc/shared
@orpc/swr
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/zod
commit: |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — docs-only correction to the tRPC column of apps/content/docs/migrations/from-trpc.mdx (tRPC v11 API fixes):
- Concept table — Context row:
t.context()→initTRPC.context<T>(), and the oRPC side toos.$context<T>(). Correct:initTRPC.context<T>().create()is the v11 form. - Error Handling: dropped
data: 'some data'from theTRPCErrorexample and reworded the intro to noteORPCErrortakes the code first and acceptsdatadirectly. UpstreamTRPCError's constructor is{ message?, code, cause? }— nodata— so this is right. - Client setup:
createTRPCProxyClient→createTRPCClient, plusimport superjsonandtransformer: superjsononhttpLink. Matches the v11 docs' canonical transformer example, and the client link must match the server'sinitTRPC...create({ transformer: superjson }).
I verified every tRPC claim against the trpc.io v11 docs and the upstream TRPCError/initTRPC sources, and the oRPC claims against this repo (os.$context<T>() at packages/server/src/builder.ts:78; ORPCError's data option at packages/client/src/error.ts:43). One thing worth noting for future edits: the untouched base example's initTRPC.context<typeof createTRPCContext>() is valid v11 — context<T>() unwraps a callback type — so it is not an oversight.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Requested by dinwwwh · project thread
Summary
The "Migrating from tRPC" guide tells readers to uninstall the v11 packages (
@trpc/tanstack-react-queryonly exists for v11), but some tRPC snippets still used v10 APIs or options tRPC doesn't support. This PR fixes only the tRPC side ofapps/content/docs/migrations/from-trpc.mdx:createTRPCProxyClient→createTRPCClient(the old name is a deprecated alias in v11).transformer: superjsontohttpLink. In v11 the transformer lives on the link, and since the server example usessuperjson, leaving it out is a type error.datafrom theTRPCErrorexample, since the constructor only takescode,message, andcause. The intro sentence now says thatORPCErroracceptsdatadirectly.initTRPC.context<T>(), nott.context(). The oRPC column now showsos.$context<T>()so the two match.Verification
@trpc/server,@trpc/client, and@trpc/tanstack-react-query11.19.0 withstrict. They compile with no errors. The previous client snippet (no transformer) and thedataoption both fail.pnpm docs:validatepasses (0 JSDoc errors,blume validate --strictfinds no broken links).Generated by Claude Code