npm @orpc/server 0.36.0
v0.36.0

latest releases: 0.0.0-next.3764ef9, 0.0.0-next.7415132, 0.0.0-next.eaec0b2...
11 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 server release

NewReleases is sending notifications on new releases.