Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server)!: fetch handler rewrite and tests with multiple coercers support #57

Merged
merged 24 commits into from
Dec 27, 2024

Conversation

unnoq
Copy link
Owner

@unnoq unnoq commented Dec 25, 2024

🚨 Breaking Changes Alert 🚨

The Fetch Handler APIs have been rewritten! Please refer to the updated documentation for details: Documentation.

What's New?

Here’s a quick example of the updated API:

const openapiHandler = new OpenAPIServerlessHandler(router, {
  schemaCoercers: [
    new ZodCoercer(), // Add your custom coercers here!
  ],
});

const orpcHandler = new ORPCHandler(router);
const compositeHandler = new CompositeHandler([openapiHandler, orpcHandler]);

// Usage examples:
openapiHandler.fetch(/***/);
orpcHandler.fetch(/***/);
compositeHandler.fetch(/***/);

Key Highlight 🚀

The introduction of schemaCoercers enables support for multiple schema types, paving the way for enhanced flexibility and the Smart Conversion feature.

Check it out and explore the possibilities!

Copy link

pkg-pr-new bot commented Dec 25, 2024

Open in Stackblitz

More templates

@orpc/client

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

@orpc/next

npm i https://pkg.pr.new/@orpc/next@57

@orpc/openapi

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

@orpc/contract

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

@orpc/react

npm i https://pkg.pr.new/@orpc/react@57

@orpc/react-query

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

@orpc/server

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

@orpc/shared

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

@orpc/vue-query

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

@orpc/zod

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

commit: ffb4aa8

Copy link

cloudflare-workers-and-pages bot commented Dec 25, 2024

Deploying orpc with  Cloudflare Pages  Cloudflare Pages

Latest commit: ffb4aa8
Status: ✅  Deploy successful!
Preview URL: https://73191c50.orpc-1qh.pages.dev
Branch Preview URL: https://feat-fetch.orpc-1qh.pages.dev

View logs

@unnoq unnoq changed the title feat(server)!: fetch handler rewrite and tests feat(server)!: fetch handler rewrite and tests with multiple coercers support Dec 26, 2024
@unnoq unnoq merged commit 93e7a4c into main Dec 27, 2024
8 checks passed
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