github unnoq/orpc v0.51.0

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

🚨 Breaking Changes 🚨

Event Iterator Keep Alive

We move configs for Event Iterator Keep Alive from .handle to handler options (define when creating handler)

Rename internal APIs

  • HandlerPlugin -> StandardHandlerPlugin
  • ClientOptions -> FriendlyClientOptions
  • ClientOptionsOut -> ClientOptions
  • ClientPlugin -> StandardLinkPlugin
  • StandardHandleOptions -> FriendlyStandardHandleOptions

🚀 Features 🚀

Body Limit Plugin

The Body Limit Plugin restricts the size of the request body.

const handler = new RPCHandler(router, {
  plugins: [
    new BodyLimitPlugin({
      maxBodySize: 1024 * 1024, // 1MB
    }),
  ],
})

No need manually check prefix

export async function fetch(request: Request): Promise<Response> {
-  const url = new URL(request.url)
-
-  if (url.pathname.startsWith('/rpc')) {
    const { response } = await handler.handle(request, {
      prefix: '/rpc',
      context: {} // Provide initial context if needed
    })

    if (response)
      return response
-  }

  return new Response('Not found', { status: 404 })
}

   🚨 Breaking Changes

   🚀 Features

   🐞 Bug Fixes

  • contract, server: Remove redundant description in .errors  -  by @unnoq in #284 (3e1c2)
  • server: ResponseHeadersPlugin context reference issues  -  by @unnoq in #293 (6d757)
    View changes on GitHub

Don't miss a new orpc release

NewReleases is sending notifications on new releases.