github unnoq/orpc v0.29.0

latest releases: v1.8.6, v1.8.5, v1.8.4...
7 months ago

🚨 Breaking Changes Alert 🚨

  • procedure is now completely non-callable by default (use the new .callable or .actionable methods for that).
  • createProcedureClient and createRouterClient now accept two arguments instead of one as before.
  • ORPCHandler and ORPCLink now become RPCHandler and RPCLink

🚀 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

    View changes on GitHub

Don't miss a new orpc release

NewReleases is sending notifications on new releases.