github unnoq/orpc v0.12.0

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

🚨 Breaking Changes Alert 🚨

We've revamped the Fetch handler APIs for a cleaner, more modular experience. Here's what you need to know:

What's Changed?

The new API lets you define handlers inline without global declarations. This simplifies your setup and keeps your bundle lightweight—especially useful for serverless environments.

import { createOpenAPIServerlessHandler } from '@orpc/openapi/fetch';
import { createORPCHandler, handleFetchRequest } from '@orpc/server/fetch';

export function fetch(request: Request) {
  return handleFetchRequest({
    router,
    request,
    prefix: '/api',
    context: {},
    handlers: [
      createORPCHandler(), 
      createOpenAPIServerlessHandler(), // Or use createOpenAPIServerHandler
    ],
  });
}

Key Benefits:

  • No Global Handler Declaration: Handlers are now scoped to the function where they're used.
  • Smaller Serverless Bundles: Bundle only the handlers you need for your use case.
  • Future-Ready: This lays the groundwork for upcoming big features (stay tuned!). 🚀

If you're upgrading, make sure to update your fetch handlers to use this new API format.

   🚨 Breaking Changes

    View changes on GitHub

Don't miss a new orpc release

NewReleases is sending notifications on new releases.