Skip to content

revert #5578 - #5793

Open
KhafraDev wants to merge 1 commit into
nodejs:mainfrom
KhafraDev:revert-5578
Open

revert #5578#5793
KhafraDev wants to merge 1 commit into
nodejs:mainfrom
KhafraDev:revert-5578

Conversation

@KhafraDev

Copy link
Copy Markdown
Member

reverts #5578 / 1089808

USE WS IF YOU NEED TO DO THIS

why does a browser implementation of WebSocket need all this bloat?

@codecov-commenter

codecov-commenter commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.52%. Comparing base (b73952a) to head (c4fcc8f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5793   +/-   ##
=======================================
  Coverage   93.51%   93.52%           
=======================================
  Files         110      110           
  Lines       39359    39337   -22     
=======================================
- Hits        36808    36791   -17     
+ Misses       2551     2546    -5     

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

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

Because this is how Node.js is supposed to interact with WHATWG spec objects that need this functionality and make the object ref'd / unref'd.

It has been there for quite some time:

https://nodejs.org/docs/latest/api/process.html#processrefmayberefable

cc @jasnell who added those in to Node.js in the first place.

@jasnell jasnell 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.

This isn't a browser implementation of WebSocket and the all caps in the PR description is really unnecessary.

@mcollina

mcollina commented Sep 9, 2026

Copy link
Copy Markdown
Member

Something that could be improved is making those property non-enumerable.

@KhafraDev

Copy link
Copy Markdown
Member Author

tbh I wrote 2 posts arguing over it not being a "browser implementation", but I deleted them since I can't be bothered arguing. I will say that if WebSocket is not a browser implementation (since it certainly isn't compatible), then it should not exist. The implementation of WebSocket is embarrassingly bad and I regret ever adding it, since I could have saved myself so much time by doing npm i ws and module.exports.WebSocket = require('ws').WebSocket.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants