Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] feat(node:net): node:net compatibility #17092

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

DonIsaac
Copy link
Contributor

@DonIsaac DonIsaac commented Feb 6, 2025

What does this PR do?

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

Very much a wip. Not ready to even be looked at.

How did you verify your code works?

@robobun
Copy link

robobun commented Feb 6, 2025

Updated 6:22 PM PT - Feb 5th, 2025

@DonIsaac, your commit ba62af9 has 9 failures in Build #11155:


🧪   try this PR locally:

bunx bun-pr 17092

* @param {T} fn
* @returns {T}
*/
function hideStackFrames(fn) {
Copy link
Collaborator

@Jarred-Sumner Jarred-Sumner Feb 6, 2025

Choose a reason for hiding this comment

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

Set the function name to ::bunternal:: and it will do this automatically

we don't want to add the overhead of calling Error.captureStackTrace in these spots


if (cluster === undefined) cluster = require("node:cluster");
Object.defineProperty(server, "_connectionKey", {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we're going to shim this then we should make sure the enumerable / writable property is set if necessary

@@ -54,7 +54,7 @@ cluster._setupWorker = function () {
};

// `obj` is a net#Server or a dgram#Socket object.
cluster._getServer = function (obj, options, cb) {
cluster._getServer = function _getServer(obj, options, cb) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this will likely become _getServer2 due to the symbol renamer

@heimskr heimskr changed the title [WIP] feat(node:net): node:net compatability [WIP] feat(node:net): node:net compatibility Feb 6, 2025
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.

3 participants