github unnoq/orpc v0.14.0

latest releases: v1.8.8, v1.8.7, v1.8.6...
9 months ago

🚨 Breaking Changes 🚨

  • The procedure caller no longer accepts FormData directly. Please use the new createFormAction for handling FormData.

  • hooks option for handleFetchRequest now rename to execute

🚀 New Features 🚀

Introducing @orpc/next, a dedicated package for Next.js! This package brings powerful new tools to enhance your development experience:

  • createFormAction: Easily create procedure callers that accept FormData.
  • createSafeAction: Build actions with enhanced error-handling capabilities for the client.
  • useSafeAction: A React hook designed for actions created with createSafeAction, providing more detailed error information.
  • useAction: A React hook for executing any orpc procedure or action, offering less detailed error information, ideal for simpler use cases.

🌟 Improvement 🌟

Any funtions like handleFetchRequest createProcedureCaller, createRouterCaller, createSafeAction, createFormAction, ... now accepts hooks to help me intercept the process

const caller = createProcedureCaller({
   procedure: getting,
   execute: async (input, context, meta) => {
       // do something
      return await meta.next()
   }
   // onStart(state, context, meta)
   // onSuccess(state, context, meta)
   // onError(state, context, meta)
   // onFinish(state, context, meta)
})

   🚨 Breaking Changes

  • server: New hooks options for handleFetchRequest  -  by @unnoq (d137c)

   🐞 Bug Fixes

  • server: InferRouterInputs & InferRouterOutputs not work with lazy router  -  by @unnoq (64276)
    View changes on GitHub

Don't miss a new orpc release

NewReleases is sending notifications on new releases.