github unnoq/orpc v0.33.0

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

🚨 Breaking Changes in Builder 🚨

The builder has been rewritten with breaking changes. Please review the following updates:

  • .config has been removed. Use .$route, .$meta, and .$config instead.
  • .context has been renamed to .$context.
  • .contract has been removed. Use the new implement function instead.
  • New .$route: Help you config initial route
  • New .$config: Help you config validation behavior (docs later)
  • New .meta and .$meta: Similar to .route, but for customizable metadata.
  • Builders now have a smaller bundle size.

🌟 Introducing the New Implementer 🌟

The new implement function fully replaces the old .contract. It is designed exclusively for Contract-First development, preventing accidental access to APIs that are not contract-compliant.

Example Usage

const os = implement(contract); // Fully replaces `os` export from @orpc/server

os.router({
  ping: os.ping.handler(() => 'pong'),
});

This update ensures stricter contract adherence while improving maintainability and performance.

   🚨 Breaking Changes

   🚀 Features

  • server: Reexport ValidationError from @orpc/contract  -  by @unnoq (f56d2)
    View changes on GitHub

Don't miss a new orpc release

NewReleases is sending notifications on new releases.