docs: add v1 to v2 migration guide - #1785
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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/nest
@orpc/next
@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: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
docs/migrations/from-v1.md— a thorough 1153-line v1→v2 migration guide covering package renames, routing viaopenapi()metadata, the procedure builder, middleware, error handling,AsyncIteratorObject, the RPC handler, server/client plugins,RPCLink, contract-first, OpenAPI, integrations, and helpers, with side-by-side v2/v1 code groups and a deprecated-alias cheat sheet.- Sidebar registration — adds the "Migrating from v1" entry above "Migrating from tRPC" in
apps/content/.vitepress/config.ts. packages/contractalias — re-exportsRouterContractClient as ContractRouterClient(type-only,@deprecated), matching the existing deprecated-alias pattern inindex.ts.
I spot-checked the load-bearing symbols and links against the current packages/* source and the docs tree, and everything holds up: the ContractRouterClient alias resolves (router-client.ts exports RouterContractClient, no name collision with the export *), RPC_DEFAULT_ALLOW_METHODS lives in @orpc/server/standard, SimpleCsrfProtectionHandlerPlugin, RPCSerializer, COMMON_ERROR_STATUS_MAP/errorStatusMap, the Next.js server-function hooks and aliases, the Hibernation renames (HibernationAsyncIteratorClass + 'close' event), the extensions/callable|route|actionable subpaths, the renamed packages and their key exports (MemoryPublisher/RedisPublisher in @orpc/publisher, createPiniaColadaUtils in @orpc/pinia-colada), and all the internal doc links resolve to existing pages. The v1-side claims can't be verified against this repo since the v1 source isn't present, but the v2 side of every checked claim is accurate.
The code change is a clean, behavior-preserving restoration of a deprecated alias so contract-first apps keep compiling during migration. Nice work.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Skipped
[v1]code fences in the docs-JSDoc verifier — previous-major snippet imports in the new migration guide are no longer validated against v2 APIs, which correctly prevents false failures for v1-only symbols. - Verified the regex
/\[v1\]\s*$/matches the exact```ts [v1]opening format used across all 34 v1 snippets indocs/migrations/from-v1.md, and that the verifier now passes cleanly (0 errors, 0 warnings).
This closes the loop on the docs-side of the migration PR: real (v2) fences stay verified, while v1 reference snippets are excluded. Good, minimal fix.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Docs prose rework — rewrote
from-v1.mdwriting: wrapped inline warnings into proper::: warning/::: tipadmonitions, and reframed the.callableand.actionablesections to recommend v2-first approaches (call/createRouterClient,createServerFunctionable) while demoting the compatibility extensions to a "if you prefer v1 style" tip. - Snippet fixes — added missing imports to v2/v1 code groups (e.g.
BatchLinkPluginfrom@orpc/client/plugins) and corrected thecreateServerFunctionableexample to match its actual factory signature. - Cheat-sheet additions — added the
useOptimisticServerAction→useOptimisticServerFunctionandcreateORPCVueColadaUtils→createPiniaColadaUtilsrows, plus an explicitcreateFormAction→createServerFormFunctionnote.
I verified every new symbol introduced in this increment against the current packages/* source: createServerFunctionable (packages/next/src/server-functionable.ts), call (packages/server/src/procedure-utils.ts — the call(getting, undefined, { context: {} }) usage matches the signature), and BatchLinkPlugin in @orpc/client/plugins. The admonition structure (each ::: warning / ::: tip opened and closed, code groups intact) is coherent in the final file. The v2-first guidance is accurate and an improvement over the previous framing.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Batch Plugin section rework — rewrote the
### Batch Pluginsection offrom-v1.md: a lead claim that the v2 plugin supports every response type (includingAsyncIteratorObjectandFile/Blob) soexcludecan usually be removed outright, a simplified v2 code-group tab with thefilterline dropped, an expanded v1excludeexample using['planets/getImage', 'planets/subscribe'].includes(path.join('/')), and the skip-batching cases (e.g. Hibernation) moved into a::: warningwith a negatedfilterexample.
I verified the load-bearing v2-side claims against packages/client/src/plugins/batch.ts: v2 BatchLinkPlugin takes filter (defaulting to () => true) and runs in streaming/buffered modes that support all response types; filter returning false means "not batched," which matches both the guide's wording and the plugin's own tests. The v2 code-group tab is valid (no filter is a valid configuration), and the negated filter example (path.join('/') !== 'chat/subscribe') correctly yields false only for the procedure that must stay unbatchable. The chore claim that exclude was mainly a workaround for unsupported response types is coherent with the surrounding v1-compatibility narrative.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Corrected the Contract Impl (implementer) section — the previous claim that the v2 implementer "gained"
.$context,.use, and.middlewarewas inaccurate; the guide now statesimplement(contract)supports these exactly as in v1, and clarifies that v2 additionally accepts a procedure config either as a second argument or through.$config, with a single v2 code example usingimplement(contract, { disableOutputValidation: true }).
I verified the v2-side claims against packages/server/src/implementer.ts: the second argument is a ProcedureConfig (implementer.ts:28), .$config (implementer.ts:41-42) and .$context (implementer.ts:38-39) are both supported, and disableOutputValidation is a valid config option. The linked /docs/advanced/validation-customization page exists. Accurate and coherent.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Adds a "Migrating from oRPC v1" guide to the docs site, covering every end-user API change between v1 and v2 with side-by-side v2/v1 code groups. Also restores
ContractRouterClientas a deprecated alias so contract-first apps keep compiling during migration.Docs
docs/migrations/from-v1.md, registered in the sidebar above "Migrating from tRPC".exclude->filtersemantics.openapi()metadata, procedure builder, middleware, error handling, AsyncIteratorObject, RPC handler, server/client plugins,RPCLink, contract-first, OpenAPI, integrations, and helpers, ending with a deprecated-alias cheat sheet. Most sections link to the relevant v2 docs page.llms-full.txtdumps; every v2 snippet symbol was verified against the currentpackages/*source, and all internal links resolve to existing pages.Contract
@orpc/contractnow exportsRouterContractClient as ContractRouterClient(type-only,@deprecated), matching the pattern of the other v1 aliases inindex.ts. The guide and its cheat sheet reflect that the old name still compiles.Testing
eslintpasses on the changed files;tsc --noEmitpasses forpackages/contract; contract export tests pass.