🚨 Breaking Changes 🚨
We've moved the core from @orpc/contract
to @orpc/client
, making @orpc/client
fully independent. It no longer requires @orpc/server
or @orpc/contract
to function.
Client Definition Changes
This update introduces a breaking change in how clients are defined:
// Before ❌
const client = createORPCClient<typeof router /* or contract */>(rpcLink)
// After ✅
const client: RouterClient<typeof router> = createORPCClient(rpcLink)
const client: ContractRouterClient<typeof contract> = createORPCClient(rpcLink)
import type { RouterClient } from '@orpc/server`
import type { ContractRouterClient } from '@orpc/contract`
🌟 Reserved Expansion Pattern Support 🌟
You can now use +
before a parameter name to match the rest of the path, including slashes (/
).
const file = os.route({ method: 'GET', path: '/{+filePath}' })
This allows for more flexible route matching, especially for handling file paths or nested segments.