BREAKING(http/unstable): remove HEADER and METHOD - #7239
Open
tomas-zijdemans wants to merge 12 commits into
Open
BREAKING(http/unstable): remove HEADER and METHOD#7239tomas-zijdemans wants to merge 12 commits into
HEADER and METHOD#7239tomas-zijdemans wants to merge 12 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
The unstable Methods module was removed in this PR; the corresponding section in the @std/http module docstring is no longer applicable. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7239 +/- ##
==========================================
- Coverage 95.03% 95.01% -0.03%
==========================================
Files 617 615 -2
Lines 51637 51424 -213
Branches 9359 9359
==========================================
- Hits 49075 48862 -213
Misses 2021 2021
Partials 541 541 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
HEADER and METHOD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This removes the unstable
HEADERandMETHODconstants from@std/http. They should never have landed: they do no work, they have already drifted from the registries they mirror, and they turn a string literal into a dependency.They do no work.
HEADER.ETagis the string"ETag". Every API these feed into (Headers,Request,fetch) takes plain strings, and editor autocomplete already catches typos. Hono, Express, and the rest don't ship a header-name catalog, because there is nothing to ship.They rot by design. The constants mirror the IANA HTTP Field Name and Method registries, so they go stale whenever those registries move. Both have drifted since the constants landed in August 2024. Stabilizing them would commit std to tracking two registries forever, for a list of strings.
They are a dependency for nothing. Importing a module to spell
"Content-Type"is a dependency std should help users avoid, not create. Two modules, roughly 1,500 lines, and a single consumer in std (file_server.ts), where the plain strings read fine (see the diff).Both modules have sat unstable for two years with no path to stabilization. Removing them now is cheap. Removing them after stabilization wouldn't be.
Earlier discussion: Discord thread