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

Separate HBRouter into a separate module #307

Closed
wants to merge 1 commit into from
Closed

Conversation

Joannis
Copy link
Contributor

@Joannis Joannis commented Dec 11, 2023

This allows Lambda users to leverage the router without having to compile NIO's HTTP code.

This allows Lambda users to leverage the router without having to compile NIO's HTTP code.
Copy link

codecov bot commented Dec 11, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (44c945e) 84.78% compared to head (874ce17) 84.84%.

Files Patch % Lines
...ummingbirdCore/RequestContext/RequestContext.swift 96.55% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            2.x.x     #307      +/-   ##
==========================================
+ Coverage   84.78%   84.84%   +0.06%     
==========================================
  Files          79       81       +2     
  Lines        4541     4559      +18     
==========================================
+ Hits         3850     3868      +18     
  Misses        691      691              

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

@adam-fowler
Copy link
Member

A first look at this implies you are not doing what you intended. HummingbirdRouter includes HummingbirdCore as a dependency which includes all the server code. You need to break the dependency on HummingbirdCore.

The only way I saw of doing this was having a HummingbirdTypes module which included (request, response, maybe context). This would then be setup as a dependency of HummingbirdCore, HummingbirdRouter, Hummingbird. But then you are also bringing extra types in HummingbirdCore by importing HummingbirdTypes. At the moment HummingbirdCore doesn't know anything about the Context protocols.

You do have one thing in here I would like to extract the maxUploadSize is now part of the request context and not the application context. With that I think we can look to ditch the application context. The other parts of it are only used by the tracing middleware and are constant values that could be passed to the tracing middleware directly.

@Joannis
Copy link
Contributor Author

Joannis commented Dec 12, 2023

@adam-fowler you're right about that, I thought splitting up HBCore would be a separate PR, but that that should come in a PR before this one. I'll work on a new PR that addresses that.

The reason I didn't do that right here, is because I didn't want this PR to grow too big so it's still reviewable.

@Joannis Joannis marked this pull request as draft December 12, 2023 12:23
@Joannis Joannis closed this Jan 11, 2024
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.

None yet

2 participants