🚨 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 newimplement
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
- contract:
- contract, server:
- server: