-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
HBRouteHandler cleanup #332
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## 2.x.x #332 +/- ##
==========================================
- Coverage 83.13% 83.10% -0.04%
==========================================
Files 92 91 -1
Lines 5009 5006 -3
==========================================
- Hits 4164 4160 -4
- Misses 845 846 +1 ☔ View full report in Codecov by Sentry. |
Pull request benchmark comparison [ubuntu-latest] with '2.x.x' run at 2024-01-05T16:30:32+00:00 |
@adam-fowler I like removing |
Then people would have to store things like the logger and allocator in the route handler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what to think of the remaining issue I've brought up, but this improvement is already a welcome one. Should we make an discussion topic/issue of my comment?
Yeah add an issue |
handle
method only gets the context as it is assumed you have extracted all you need from the request ininit
HBRequestDecodable
as soon as that was released I hated it.Not sure if I'll keep the route handlers as it is hard to do dependency injection with them. But for the moment I've cleaned up everything a little
I also changed
HBRequest.decode(as:using)
toHBRequest.decode(as:context)
. I don't useusing
to pass the context around anyway else. It is always context. This change went in here as it clashed with the rest of this PR