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

refactor(exposition): remove express #525

Merged
merged 5 commits into from
Feb 26, 2024
Merged

refactor(exposition): remove express #525

merged 5 commits into from
Feb 26, 2024

Conversation

temich
Copy link
Contributor

@temich temich commented Feb 25, 2024

The next step is the transition to HTTP2.

@codecov-commenter
Copy link

codecov-commenter commented Feb 25, 2024

Codecov Report

Attention: Patch coverage is 38.50416% with 222 lines in your changes are missing coverage. Please review.

Project coverage is 54.09%. Comparing base (a52670a) to head (3f420b7).
Report is 78 commits behind head on dev.

Files Patch % Lines
extensions/exposition/source/Gateway.ts 0.00% 29 Missing ⚠️
...sions/exposition/source/directives/octets/Fetch.ts 0.00% 29 Missing ⚠️
...ions/exposition/source/directives/octets/Delete.ts 0.00% 19 Missing ⚠️
...sions/exposition/source/directives/octets/Store.ts 0.00% 18 Missing ⚠️
extensions/exposition/source/HTTP/Context.ts 76.11% 16 Missing ⚠️
...nsions/exposition/source/directives/octets/List.ts 0.00% 14 Missing ⚠️
...ons/exposition/source/directives/octets/Permute.ts 0.00% 12 Missing ⚠️
...nsions/exposition/source/directives/auth/Incept.ts 0.00% 11 Missing ⚠️
extensions/exposition/source/HTTP/messages.ts 70.96% 9 Missing ⚠️
extensions/exposition/source/Mapping.ts 0.00% 7 Missing ⚠️
... and 20 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #525      +/-   ##
==========================================
- Coverage   56.13%   54.09%   -2.05%     
==========================================
  Files         318      334      +16     
  Lines       10405    11144     +739     
  Branches     1260     1280      +20     
==========================================
+ Hits         5841     6028     +187     
- Misses       4564     5116     +552     
Flag Coverage Δ
unit 54.09% <38.50%> (-2.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@@ -83,9 +83,10 @@ export class Gateway extends Connector {
throw new http.MethodNotAllowed()

const body = await request.parse()
const query = Object.fromEntries(request.locator.searchParams)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not always a good idea to do 1:1 mapping between searchParams and an object as search params can have repeated queries (for example, to represent an array of value in a standard way).
Are we sure we never will want repeated parameters in the searchParams? I would rather keep query as standard URLSearchParams as it seems to be more flexible.

Copy link
Contributor Author

@temich temich Feb 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any operation in Toa accepts Request type. Exposition definitely transforms HTTP Request into operation Request (body goes to input, and query string parsed into query).

There is no such thing as an arbitrary query string in the Exposition. Anything not matching Query type will not pass operation call's validation and result in Bad Request.

extensions/exposition/source/HTTP/Server.ts Outdated Show resolved Hide resolved
extensions/exposition/source/HTTP/Server.ts Outdated Show resolved Hide resolved
extensions/exposition/source/HTTP/messages.ts Show resolved Hide resolved
@temich temich merged commit 98b7cdf into dev Feb 26, 2024
3 checks passed
@temich temich deleted the refactor/bye-bye-expresss branch February 26, 2024 12:20
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.

3 participants