github unnoq/orpc v0.36.0

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

🚨 Breaking Changes 🚨

  • The onError, onSuccess, and similar hooks have been completely removed from all APIs. Please use the new interceptors instead.
  • The ZodCoercer has been removed. Use the new ZodAutoCoercePlugin instead.

🌟 ZodAutoCoercePlugin 🌟

The ZodAutoCoercePlugin fully replaces ZodCoercer for automatically coercing types based on your schema.

const openAPIHandler = new OpenAPIHandler(router, {
  interceptors: [
    onError((error) => {
      console.error(error)
    }),
  ],
  plugins: [
    new CORSPlugin({
      origin: 'http://localhost:3000',
    }),
    new ResponseHeadersPlugin(),
    new ZodAutoCoercePlugin(),
  ],
})

Note: Do not use ZodAutoCoercePlugin in RPCHandler as it is unnecessary and impacts performance.

   🚨 Breaking Changes

   🚀 Features

  • server: Support Timing-Allow-Origin in CORSPlugin  -  by @unnoq and Alexander Niebuhr in #124 (b825e)
    View changes on GitHub

Don't miss a new orpc release

NewReleases is sending notifications on new releases.