Skip to content

lib: deprecate _http_* - #58535

Open
bjohansebas wants to merge 1 commit into
nodejs:mainfrom
bjohansebas:http_internals
Open

bjohansebas wants to merge 1 commit into
nodejs:mainfrom
bjohansebas:http_internals

Conversation

@bjohansebas

Copy link
Copy Markdown
Member

close #58534

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http
  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added http Issues and PRs related to the http subsystem. needs-ci PRs that need a full CI run. labels May 31, 2025
@bjohansebas bjohansebas added the wip Issues and PRs that are still a work in progress. label May 31, 2025
@bjohansebas
bjohansebas force-pushed the http_internals branch 2 times, most recently from 11b6878 to 329d0a0 Compare May 31, 2025 20:17
@bjohansebas bjohansebas added semver-major PRs that contain breaking changes and should be released in the next major version. deprecations Issues and PRs related to deprecations. labels May 31, 2025
@bjohansebas
bjohansebas marked this pull request as ready for review May 31, 2025 21:29
@bjohansebas bjohansebas removed the wip Issues and PRs that are still a work in progress. label May 31, 2025
@bjohansebas
bjohansebas force-pushed the http_internals branch 2 times, most recently from 0ec4ccc to bd305a8 Compare May 31, 2025 23:17
Comment thread benchmark/http/check_is_http_token.js Outdated
@jasnell

jasnell commented May 31, 2025

Copy link
Copy Markdown
Member

@nodejs/http @mcollina

@jasnell

jasnell commented May 31, 2025

Copy link
Copy Markdown
Member

This one might need a Documentation-only deprecation to start. It's likely going to be too disruptive to go straight to a Runtime deprecation. https://github.com/search?type=code&q=%22require%28%27_http%22

@dario-piotrowicz dario-piotrowicz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yay! thanks for doing this! 🫶

(with this all pesky _modules will be runtime deprecated! 💪)

Comment thread test/parallel/test-warn-http-server-deprecation.js Outdated
Comment thread test/parallel/test-https-server-close-destroy-timeout.js
Comment thread benchmark/http/check_is_http_token.js Outdated
Comment thread benchmark/http/check_invalid_header_char.js Outdated
@bjohansebas

Copy link
Copy Markdown
Member Author

This one might need a Documentation-only deprecation to start. It's likely going to be too disruptive to go straight to a Runtime deprecation. https://github.com/search?type=code&q=%22require%28%27_http%22

Most of them seem to be just forks of Node.js, rather than actually using these undocumented modules.

@jasnell

jasnell commented May 31, 2025

Copy link
Copy Markdown
Member

Most of them seem to be just forks of Node.js....

I wish that were the case. While there are a good number of forks in those search results, it's plain to see that there are a non-trivial number of other projects requiring "_http_common" and friends. We need to assess just how disruptive this will be... but don't get me wrong, I am in favor of deprecated these but it might need to be a slower path. I'd like @nodejs/http folks to weigh in.

@codecov

codecov Bot commented Jun 1, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.38903% with 160 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.47%. Comparing base (a7a96c2) to head (9c2d4ba).

Files with missing lines Patch % Lines
lib/internal/http/server.js 96.64% 49 Missing and 3 partials ⚠️
lib/internal/http/client.js 97.39% 34 Missing ⚠️
lib/internal/http/outgoing.js 97.98% 28 Missing and 2 partials ⚠️
lib/internal/http/agent.js 96.64% 23 Missing and 1 partial ⚠️
lib/internal/http/incoming.js 97.66% 14 Missing and 1 partial ⚠️
lib/internal/http/common.js 98.55% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58535      +/-   ##
==========================================
- Coverage   90.47%   90.47%   -0.01%     
==========================================
  Files         791      797       +6     
  Lines      277088   277354     +266     
  Branches    53286    53292       +6     
==========================================
+ Hits       250703   250943     +240     
- Misses      16805    16814       +9     
- Partials     9580     9597      +17     
Files with missing lines Coverage Δ
lib/_http_agent.js 100.00% <100.00%> (+3.35%) ⬆️
lib/_http_client.js 100.00% <100.00%> (+2.60%) ⬆️
lib/_http_common.js 100.00% <100.00%> (+1.44%) ⬆️
lib/_http_incoming.js 100.00% <100.00%> (+2.33%) ⬆️
lib/_http_outgoing.js 100.00% <100.00%> (+2.01%) ⬆️
lib/_http_server.js 100.00% <100.00%> (+3.22%) ⬆️
lib/http.js 99.11% <100.00%> (ø)
lib/https.js 97.21% <100.00%> (ø)
lib/internal/child_process.js 95.12% <100.00%> (ø)
lib/internal/http2/compat.js 97.25% <100.00%> (+<0.01%) ⬆️
... and 8 more

... and 30 files with indirect coverage changes

🚀 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.

Comment thread benchmark/http/check_invalid_header_char.js Outdated
Comment thread lib/_http_common.js
Comment thread test/parallel/test-https-server-close-destroy-timeout.js
@bjohansebas

Copy link
Copy Markdown
Member Author

@nodejs/http what are your recommendations?

bjohansebas added a commit to bjohansebas/node that referenced this pull request Jul 31, 2025
Ref nodejs#58535

Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
nodejs-github-bot pushed a commit that referenced this pull request Aug 2, 2025
Ref #58535

Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
PR-URL: #59293
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
@bjohansebas bjohansebas added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jul 14, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jul 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor
Failed to start CI
- Validating Jenkins credentials
✔  Jenkins credentials valid
- Querying data for job/node-test-pull-request/71184/
[SyntaxError: Unexpected token '<', ..."    
  https://github.com/nodejs/node/actions/runs/29348029768

@bjohansebas bjohansebas added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. and removed request-ci-failed Starting CI with the request-ci label failed and requires manual intervention. labels Jul 14, 2026
@bjohansebas

Copy link
Copy Markdown
Member Author

Could someone rerun the failed job?

@github-actions github-actions Bot added request-ci-failed Starting CI with the request-ci label failed and requires manual intervention. and removed request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Jul 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor
Failed to start CI
- Validating Jenkins credentials
✔  Jenkins credentials valid
- Querying data for job/node-test-pull-request/71184/
[SyntaxError: Unexpected token '<', ..."    
  https://github.com/nodejs/node/actions/runs/29350483155

@bjohansebas bjohansebas added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. and removed request-ci-failed Starting CI with the request-ci label failed and requires manual intervention. labels Jul 14, 2026
@github-actions github-actions Bot added request-ci-failed Starting CI with the request-ci label failed and requires manual intervention. and removed request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Jul 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor
Failed to start CI
- Validating Jenkins credentials
✔  Jenkins credentials valid
- Querying data for job/node-test-pull-request/71184/
[SyntaxError: Unexpected token '<', ..."    
  https://github.com/nodejs/node/actions/runs/29363308681

@aduh95

aduh95 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

There are conflicts to fix

@aduh95 aduh95 removed fast-track PRs proposed for a shorter-than-standard waiting period before landing. author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci-failed Starting CI with the request-ci label failed and requires manual intervention. labels Aug 25, 2026
Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
@bjohansebas bjohansebas added the review wanted PRs that need review. label Oct 12, 2026

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@avivkeller avivkeller left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@bjohansebas bjohansebas added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. and removed http Issues and PRs related to the http subsystem. labels Oct 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The notable-change PRs with changes that should be highlighted in changelogs. label has been added by @bjohansebas.

Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. deprecations Issues and PRs related to deprecations. http Issues and PRs related to the http subsystem. notable-change PRs with changes that should be highlighted in changelogs. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move _http_* to be internal APIs.