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

BREAKING(http/unstable): switch params and info args in Handler in route() for more conveniency #6094

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

lowlighter
Copy link
Contributor

Closes #5884

Not sure if it qualifies for "breaking change" since the API is still unstable, but it does break apps relying on current implementation route()

As explained in the linked issue, since params: URLPatternResult is way more likely to be used than info: Deno.ServeHandlerInfo in non-default handlers, it makes sense to switch them for improved DX

@github-actions github-actions bot added the http label Oct 5, 2024
Copy link

codecov bot commented Oct 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.52%. Comparing base (065296c) to head (4c43d31).
Report is 82 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6094      +/-   ##
==========================================
- Coverage   96.75%   96.52%   -0.24%     
==========================================
  Files         509      534      +25     
  Lines       39175    40976    +1801     
  Branches     5795     6134     +339     
==========================================
+ Hits        37905    39553    +1648     
- Misses       1228     1381     +153     
  Partials       42       42              

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

@lowlighter lowlighter marked this pull request as ready for review October 5, 2024 17:13
@lowlighter lowlighter requested a review from kt3k as a code owner October 5, 2024 17:13
@lowlighter lowlighter changed the title BREAKING(http): switch params and info args in Handler in route() for more conveniency BREAKING(http/unstable): switch params and info args in Handler in route() for more conveniency Oct 5, 2024
@kt3k kt3k added the feedback welcome We want community's feedback on this issue or PR label Oct 29, 2024
Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM.

There should be more usages for params than info in general. This change makes sense.

@kt3k
Copy link
Member

kt3k commented Oct 29, 2024

We recently removed the dependency to (unstable) route in main of CLI (in deno init --serve). ref. denoland/deno#26595

I think we still need to wait for a while (at least a few versions of CLI releases) to land this PR to avoid the troubles.

@kt3k kt3k changed the title BREAKING(http/unstable): switch params and info args in Handler in route() for more conveniency [on hold] BREAKING(http/unstable): switch params and info args in Handler in route() for more conveniency Oct 29, 2024
@kt3k kt3k changed the title [on hold] BREAKING(http/unstable): switch params and info args in Handler in route() for more conveniency BREAKING(http/unstable): switch params and info args in Handler in route() for more conveniency Dec 5, 2024
@kt3k
Copy link
Member

kt3k commented Dec 5, 2024

We've released 3 versions of CLI (2.1.0, 2.1.1, 2.1.1) which don't use unstable route function in deno init --serve output.

I think it's time we can land this.

@kt3k kt3k merged commit ed06cbd into denoland:main Dec 5, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback welcome We want community's feedback on this issue or PR http
Projects
None yet
Development

Successfully merging this pull request may close these issues.

qol(http/route): typings and handler signature
2 participants