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
@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 provinzkraut enabled auto-merge (squash) May 25, 2024 09:37
Copy link

sonarcloud bot commented May 25, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
7 New Major Issues (required ≤ 2)
8 New Code Smells (required ≤ 3)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3436

@provinzkraut provinzkraut merged commit 4dc78a8 into v3.0 May 25, 2024
27 of 28 checks passed
@provinzkraut provinzkraut deleted the route-handler-decorators branch May 25, 2024 10:05
provinzkraut added a commit that referenced this pull request May 26, 2024
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jun 15, 2024
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jun 16, 2024
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jun 21, 2024
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Jul 21, 2024
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Aug 25, 2024
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Aug 27, 2024
* make route handlers functional decorators
provinzkraut added a commit that referenced this pull request Aug 28, 2024
* 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.

None yet

3 participants