Skip to content

BREAKING(http/unstable): remove HEADER and METHOD - #7239

Open
tomas-zijdemans wants to merge 10 commits into
denoland:mainfrom
tomas-zijdemans:remove-headers-and-methods
Open

BREAKING(http/unstable): remove HEADER and METHOD#7239
tomas-zijdemans wants to merge 10 commits into
denoland:mainfrom
tomas-zijdemans:remove-headers-and-methods

Conversation

@tomas-zijdemans

@tomas-zijdemans tomas-zijdemans commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

This removes the unstable HEADER and METHOD constants from @std/http. They mirror two IANA registries we'd have to track forever, and they add little over plain strings.

Rationale:

  • They go stale. Both constants have drifted from the IANA registries since they landed in August 2024. fix(http/unstable): sync HEADER const with IANA registry #6991 and fix(http/unstable): sync METHOD with IANA registry #6992 exist only to resync them, and that work never ends: stabilizing these modules commits std to tracking the HTTP Field Name and Method registries indefinitely.
  • The payoff is thin. The constants map names to the strings themselves (HEADER.ETag is "ETag"), and every web API involved (Headers, Request, fetch) takes plain strings. Typo protection is the main benefit, and editor autocomplete covers that.
  • The cost isn't. Two modules, roughly 1,500 lines, for a list of string literals. file_server.ts was the only consumer in std, and the plain strings read fine there (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.

If we'd rather keep them, #6991 and #6992 should be merged instead so the constants at least match the current registries.

Earlier discussion: Discord thread

@github-actions github-actions Bot added the http label Jul 15, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.01%. Comparing base (df4d14d) to head (3410c8e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7239      +/-   ##
==========================================
- Coverage   95.03%   95.01%   -0.03%     
==========================================
  Files         619      616       -3     
  Lines       51499    51283     -216     
  Branches     9301     9300       -1     
==========================================
- Hits        48940    48724     -216     
  Misses       2021     2021              
  Partials      538      538              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tomas-zijdemans tomas-zijdemans changed the title refactor(http): remove unstable header and method modules BREAKING(http/unstable): remove HEADER and METHOD Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants