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!: Make route handlers functional decorators #3436

Merged
merged 17 commits into from
May 25, 2024

Conversation

provinzkraut
Copy link
Member

@provinzkraut provinzkraut commented Apr 27, 2024

Make route handler decorators functional decorators.

This gets rids of the __call__ method having to mutate internal state and lets us clean up things a bit.

It also makes for a nicer syntax and improved type/runtime checking of the handler classes, because they can now receive a fn as a required keyword argument, which gets rid of the HandlerClass("/")(handler_fn) pattern.

@github-actions github-actions bot added area/handlers This PR involves changes to the handlers area/private-api This PR involves changes to the privatized API area/testing area/types This PR involves changes to the custom types size: large type/feat area/channels pr/internal area/controller labels Apr 27, 2024
Copy link

codecov bot commented Apr 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.99%. Comparing base (8aae5d8) to head (dbe473f).

Additional details and impacted files
@@           Coverage Diff           @@
##             v3.0    #3436   +/-   ##
=======================================
  Coverage   97.98%   97.99%           
=======================================
  Files         326      326           
  Lines       14566    14559    -7     
  Branches     2314     2306    -8     
=======================================
- Hits        14273    14267    -6     
  Misses        154      154           
+ Partials      139      138    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added the area/docs This PR involves changes to the documentation label Apr 27, 2024
@provinzkraut provinzkraut marked this pull request as ready for review April 27, 2024 14:25
@provinzkraut provinzkraut requested review from a team as code owners April 27, 2024 14:25
@provinzkraut provinzkraut force-pushed the route-handler-decorators branch from 98bf1ab to 48ab468 Compare April 27, 2024 14:35
@github-actions github-actions bot added area/ci This PR involves changes to the CI/Infra area/connection area/constants This PR involves changes to the constants area/contrib This PR involves changes to the contrib (Deprecated) area/dependencies This PR involves changes to the dependencies area/kwargs area/middleware This PR involves changes to the middleware area/openapi This PR involves changes to the OpenAPI schema area/response area/router area/static-files area/template labels Apr 27, 2024
provinzkraut added a commit that referenced this pull request Nov 29, 2024
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Dec 12, 2024
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Dec 13, 2024
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Dec 13, 2024
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Dec 13, 2024
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Dec 13, 2024
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Dec 13, 2024
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 11, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 11, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 11, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 11, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 11, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 11, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 11, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 11, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 11, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 11, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 11, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 11, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 11, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 15, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 15, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 15, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 15, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 15, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 15, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 15, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jan 28, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Feb 14, 2025
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Feb 16, 2025
* make route handlers functional decorators
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/channels area/controller area/docs This PR involves changes to the documentation area/handlers This PR involves changes to the handlers area/private-api This PR involves changes to the privatized API area/testing area/types This PR involves changes to the custom types Breaking 🔨 pr/internal size: large type/feat
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants