Skip to content

feat(contract, server)!: rewrite builders#110

Merged
dinwwwh merged 58 commits intomainfrom
feat/server/sync-new-builders
Jan 31, 2025
Merged

feat(contract, server)!: rewrite builders#110
dinwwwh merged 58 commits intomainfrom
feat/server/sync-new-builders

Conversation

@dinwwwh
Copy link
Copy Markdown
Member

@dinwwwh dinwwwh commented Jan 31, 2025

🚨 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.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 31, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
orpc ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 31, 2025 1:11pm

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jan 31, 2025

Open in Stackblitz

More templates

@orpc/client

npm i https://pkg.pr.new/@orpc/client@110

@orpc/contract

npm i https://pkg.pr.new/@orpc/contract@110

@orpc/openapi

npm i https://pkg.pr.new/@orpc/openapi@110

@orpc/react-query

npm i https://pkg.pr.new/@orpc/react-query@110

@orpc/server

npm i https://pkg.pr.new/@orpc/server@110

@orpc/shared

npm i https://pkg.pr.new/@orpc/shared@110

@orpc/vue-colada

npm i https://pkg.pr.new/@orpc/vue-colada@110

@orpc/zod

npm i https://pkg.pr.new/@orpc/zod@110

@orpc/vue-query

npm i https://pkg.pr.new/@orpc/vue-query@110

commit: c188f9f

@dinwwwh dinwwwh changed the title feat: sync with new builders feat(contract, server)!: rewrite builders Jan 31, 2025
@dinwwwh dinwwwh merged commit 32cb70c into main Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant