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)!: rename .func() to .handler() #60

Merged
merged 4 commits into from
Dec 30, 2024

Conversation

unteifu
Copy link
Contributor

@unteifu unteifu commented Dec 27, 2024

I think the .func() function should be renamed to .handler() as visually it doesn't make sense at first and looks very vague, this was something I found confusing when I first saw the docs. Calling it .handler() means developers, know ok this is what will be the endpoints main handling logic after all middleware and validation.

Copy link

pkg-pr-new bot commented Dec 27, 2024

Open in Stackblitz

More templates

@orpc/client

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

@orpc/next

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

@orpc/contract

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

@orpc/openapi

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

@orpc/react

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

@orpc/react-query

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

@orpc/server

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

@orpc/shared

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

@orpc/vue-query

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

@orpc/zod

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

commit: 64faa72

@unnoq
Copy link
Owner

unnoq commented Dec 28, 2024

oRPC start with .handler but has been rename to .func because it describe widely ability of oRPC (you can call directly procedure as native function).

But it only is my opinion, and English is not my first language so I will carefully consider it

@unnoq
Copy link
Owner

unnoq commented Dec 28, 2024

.handler, ORPCHandler, and OpenAPIHandler seem conflict name here

@unteifu
Copy link
Contributor Author

unteifu commented Dec 28, 2024

.handler, ORPCHandler, and OpenAPIHandler seem conflict name here

I think that's completely fine to have still because it still runs on the basis of "this is the function/codeblock that handles the logic", like OpenAPIHandler handles that specifically and you know that middleware will do that.

@unnoq
Copy link
Owner

unnoq commented Dec 29, 2024

@unteifu please resolve conflict, and go to apps/content run pnpm run build and I will merge this!

@unteifu
Copy link
Contributor Author

unteifu commented Dec 29, 2024

I've just merged the docs update with this branch as it means the docs will be up to date with this commit then and also pass CI

@unnoq unnoq changed the title refactor(server): Renamed .func() to .handler() refactor(server): rename .func() to .handler() Dec 30, 2024
@unnoq unnoq changed the title refactor(server): rename .func() to .handler() feat(server)!: rename .func() to .handler() Dec 30, 2024
@unnoq unnoq merged commit 5d3da98 into unnoq:main Dec 30, 2024
4 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.

2 participants