npm @orpc/client 0.12.0
v0.12.0

latest releases: 1.13.0, 0.0.0-next.f01f7b1, 0.0.0-next.b2d00a3...
12 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 client release

NewReleases is sending notifications on new releases.