http: runtime deprecate instantiating without new - #64853
Open
anonrig wants to merge 1 commit into
Open
Conversation
Collaborator
|
Review requested:
|
anonrig
force-pushed
the
http-runtime-dep0195
branch
from
July 30, 2026 21:23
e88a573 to
08c1731
Compare
Promote DEP0195 from documentation-only to a runtime deprecation. Calling node:http constructors without `new` now emits DEP0195 via deprecateInstantiation. This covers Agent, Server, OutgoingMessage, IncomingMessage, ServerResponse, and ClientRequest. Update in-tree tests that called Server/Agent without `new` to use the keyword, and add a dedicated DEP0195 coverage test. Refs: nodejs#58518 Assisted-by: Grok Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
anonrig
force-pushed
the
http-runtime-dep0195
branch
from
July 30, 2026 21:41
08c1731 to
e42b138
Compare
avivkeller
approved these changes
Jul 30, 2026
bjohansebas
approved these changes
Jul 30, 2026
efekrskl
approved these changes
Jul 30, 2026
This comment was marked as outdated.
This comment was marked as outdated.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #64853 +/- ##
==========================================
- Coverage 91.98% 90.15% -1.83%
==========================================
Files 381 746 +365
Lines 167876 242788 +74912
Branches 25662 45776 +20114
==========================================
+ Hits 154414 218881 +64467
- Misses 13175 15404 +2229
- Partials 287 8503 +8216
🚀 New features to boost your workflow:
|
pimterry
approved these changes
Jul 31, 2026
Collaborator
gurgunday
approved these changes
Jul 31, 2026
Member
Author
|
cc @nodejs/tsc this is a semver-major. needs more reviews |
Collaborator
panva
approved these changes
Jul 31, 2026
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.
Description
Promote DEP0195 from Documentation-only to Runtime.
Calling
node:httpconstructors withoutnewnow emits aDeprecationWarning(DEP0195) viadeprecateInstantiation, matching the earlier runtime path for zlib (DEP0184) and repl (DEP0185).Covered constructors
AgentnewServernewOutgoingMessagethisIncomingMessageServerResponseClientRequestcreateServer()/request()/get()paths are unchanged (they already usenew).Tests
test/parallel/test-http-dep0195.jshttp.Server(...)/http.Agent(...)withoutnewMigration
Test plan
parallel/test-http-dep0195make lint-jscore-validate-commitRefs: #58518