🚨 Breaking Changes Alert 🚨
procedure
is now completely non-callable by default (use the new.callable
or.actionable
methods for that).createProcedureClient
andcreateRouterClient
now accept two arguments instead of one as before.ORPCHandler
andORPCLink
now becomeRPCHandler
andRPCLink
🚀 New Features 🚀
- New
.callable
method to make a procedure callable like a regular function. - New
.actionable
method, similar to.callable()
, but type-compatible with server actions (yes, server actions work again). - New
call()
helper function to directly call any procedure without creating a client.
'use server'
import { os } from '@orpc/server'
import { z } from 'zod'
export const getting = os
.input(z.object({
name: z.string(),
}))
.output(z.string())
.handler(async ({ input }) => {
return `Hello ${input.name}`
})
.actionable()
// from client just call it as a function
const onClick = async () => {
const result = await getting({ name: 'Unnoq' })
alert(result)
}
🚨 Breaking Changes
- server: Redesign callable ability - by @unnoq in #78 (23aa4)
- server, client: Rename ORPCHandler/Link -> RPCHandler/Link - by @unnoq in #79 (c6c65)