Skip to content

Conversation

@aduh95
Copy link
Contributor

@aduh95 aduh95 commented May 11, 2022

This reverts commits 68fb0bf, 4ad342a, and 3a26db9.

Fixes: #43014

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels May 11, 2022
@aduh95 aduh95 added semver-major PRs that contain breaking changes and should be released in the next major version. tsc-agenda Issues and PRs to discuss during the meetings of the TSC. labels May 11, 2022
@targos
Copy link
Member

targos commented May 11, 2022

IMO the revert doesn't make sense if it is semver-major, because everyone will have to adapt to the change for v18 (which is going to be LTS).

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina
Copy link
Member

+1 to land it on Node v18.

@mcollina mcollina added semver-major PRs that contain breaking changes and should be released in the next major version. and removed semver-major PRs that contain breaking changes and should be released in the next major version. labels May 11, 2022
@mcollina
Copy link
Member

mcollina commented May 11, 2022

@nodejs/tsc at Today meeting we did not have quorum to LGTM as a non-semver-major change. Does anybody from the TSC objects to this?

We actually had quorum at the end of the meeting, we approve landing this as semver-minor.

@mcollina mcollina added semver-minor PRs that contain new features and should be released in the next minor version. dont-land-on-v12.x and removed semver-major PRs that contain breaking changes and should be released in the next major version. labels May 11, 2022
@RaisinTen RaisinTen added the notable-change PRs with changes that should be highlighted in changelogs. label May 11, 2022
@RaisinTen
Copy link
Member

Is it okay if we remove this from the tsc-agenda now, since everyone in the meeting was +1 with reverting?

@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. and removed backport-requested-v18.x labels May 11, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 11, 2022
@nodejs-github-bot

This comment was marked as outdated.

Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

Rubber stamp

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@mhdawson
Copy link
Member

We discussed in the TSC meeting and there were no objections to this landing. Doing that now.

mhdawson pushed a commit that referenced this pull request Jun 15, 2022
Refs: #43014

PR-URL: #43054
Fixes: #43014
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
@mhdawson
Copy link
Member

Landed as 70b516e

@mhdawson mhdawson closed this Jun 15, 2022
@aduh95 aduh95 mentioned this pull request Jun 15, 2022
danielleadams pushed a commit that referenced this pull request Jun 16, 2022
Refs: #43014

PR-URL: #43054
Fixes: #43014
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
danielleadams added a commit that referenced this pull request Jun 16, 2022
Notable changes:

* crypto:
  * remove Node.js-specific webcrypto extensions (Filip Skokan) #43310
  * add CFRG curves to Web Crypto API (Filip Skokan) #42507
* dns:
  * accept `'IPv4'` and `'IPv6'` for `family` (Antoine du Hamel) #43054
* report:
  * add more heap infos in process report (theanarkh) #43116

PR-URL: #43385
danielleadams added a commit that referenced this pull request Jun 16, 2022
Notable changes:

* crypto:
  * remove Node.js-specific webcrypto extensions (Filip Skokan) #43310
  * add CFRG curves to Web Crypto API (Filip Skokan) #42507
* dns:
  * accept `'IPv4'` and `'IPv6'` for `family` (Antoine du Hamel) #43054
* report:
  * add more heap infos in process report (theanarkh) #43116

PR-URL: #43385
danielleadams added a commit that referenced this pull request Jun 16, 2022
Notable changes:

* crypto:
  * remove Node.js-specific webcrypto extensions (Filip Skokan) #43310
  * add CFRG curves to Web Crypto API (Filip Skokan) #42507
* dns:
  * accept `'IPv4'` and `'IPv6'` for `family` (Antoine du Hamel) #43054
* report:
  * add more heap infos in process report (theanarkh) #43116

PR-URL: #43385
@aduh95 aduh95 deleted the revert-net-family-integer branch March 29, 2023 16:00
nrako added a commit to nrako/deno that referenced this pull request Nov 30, 2025
Aligns Deno's `server.address()` with Node.js v18.4.0+ behavior by
returning the `family` property as a string ("IPv4" or "IPv6") rather
than a number.

Node.js briefly changed `family` from string to number in v18.0.0
(nodejs/node#41431), but reverted in v18.4.0 (nodejs/node#43054) due
to ecosystem breakage (nodejs/node#43014).

This fix ensures compatibility with npm packages that rely on the
string format, which has been the stable API since Node.js v18.4.0.

Refs:
- nodejs/node#43054
- nodejs/node@70b516e

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
nrako added a commit to nrako/deno that referenced this pull request Nov 30, 2025
Aligns Deno's `server.address()` with Node.js v18.4.0+ behavior by
returning the `family` property as a string ("IPv4" or "IPv6") rather
than a number.

Node.js briefly changed `family` from string to number in v18.0.0
(nodejs/node#41431), but reverted in v18.4.0 (nodejs/node#43054) due
to ecosystem breakage (nodejs/node#43014).

This fix ensures compatibility with npm packages that rely on the
string format, which has been the stable API since Node.js v18.4.0.

Refs:
- nodejs/node#43054
- nodejs/node@70b516e

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
nrako added a commit to nrako/deno that referenced this pull request Nov 30, 2025
Aligns Deno's `server.address()` with Node.js v18.4.0+ behavior by
returning the `family` property as a string ("IPv4" or "IPv6") rather
than a number.

Node.js briefly changed `family` from string to number in v18.0.0
(nodejs/node#41431), but reverted in v18.4.0 (nodejs/node#43054) due
to ecosystem breakage (nodejs/node#43014).

This fix ensures compatibility with npm packages that rely on the
string format, which has been the stable API since Node.js v18.4.0.

Refs:
- nodejs/node#43054
- nodejs/node@70b516e

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
nrako added a commit to nrako/deno that referenced this pull request Nov 30, 2025
Aligns Deno's `server.address()` with Node.js v18.4.0+ behavior by
returning the `family` property as a string ("IPv4" or "IPv6") rather
than a number.

Node.js briefly changed `family` from string to number in v18.0.0
(nodejs/node#41431), but reverted in v18.4.0 (nodejs/node#43054) due
to ecosystem breakage (nodejs/node#43014).

This fix ensures compatibility with npm packages that rely on the
string format, which has been the stable API since Node.js v18.4.0.

Refs:
- nodejs/node#43054
- nodejs/node@70b516e

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
nrako added a commit to nrako/deno that referenced this pull request Nov 30, 2025
Aligns Deno's `server.address()` with Node.js v18.4.0+ behavior by
returning the `family` property as a string ("IPv4" or "IPv6") rather
than a number.

Node.js briefly changed `family` from string to number in v18.0.0
(nodejs/node#41431), but reverted in v18.4.0 (nodejs/node#43054) due
to ecosystem breakage (nodejs/node#43014).

This fix ensures compatibility with npm packages that rely on the
string format, which has been the stable API since Node.js v18.4.0.

Refs:
- nodejs/node#43054
- nodejs/node@70b516e

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
nrako added a commit to nrako/deno that referenced this pull request Nov 30, 2025
Aligns Deno's Node.js compatibility layer with Node.js v18.4.0+ behavior
by returning the `family` property as a string ("IPv4" or "IPv6") rather
than a number in `server.address()` and socket address methods.

Node.js briefly changed `family` from string to number in v18.0.0
(nodejs/node#41431), but reverted in v18.4.0 (nodejs/node#43054) due to
ecosystem breakage (nodejs/node#43014).

Changes:
- `http.Server.address()`, `https.Server.address()`, `http2.Server.address()`
  now include `family` property as string
- `net.Server.address()` returns string `family` via tcp_wrap.ts
- `socket.remoteFamily` returns string instead of number
- `dns.lookup()` accepts both numeric (0, 4, 6) and string ("IPv4", "IPv6")
  family values, matching Node.js behavior

Family value derivation follows Node.js C++ implementation:
- isIP() === 4 → "IPv4"
- isIP() === 6 → "IPv6"
- isIP() === 0 → undefined (defensive, matches Node.js behavior for
  non-IP addresses, though not practically reachable via TCP server APIs)

Refs:
- nodejs/node#43054
- nodejs/node@70b516e

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
nrako added a commit to nrako/deno that referenced this pull request Dec 4, 2025
Aligns Deno's Node.js compatibility layer with Node.js v18.4.0+ behavior
by returning the `family` property as a string ("IPv4" or "IPv6") rather
than a number in `server.address()` and socket address methods.

Node.js briefly changed `family` from string to number in v18.0.0
(nodejs/node#41431), but reverted in v18.4.0 (nodejs/node#43054) due to
ecosystem breakage (nodejs/node#43014).

Changes:
- `http.Server.address()`, `https.Server.address()`, `http2.Server.address()`
  now include `family` property as string
- `net.Server.address()` returns string `family` via tcp_wrap.ts
- `socket.remoteFamily` returns string instead of number
- `dns.lookup()` accepts both numeric (0, 4, 6) and string ("IPv4", "IPv6")
  family values, matching Node.js behavior

Family value derivation follows Node.js C++ implementation:
- isIP() === 4 → "IPv4"
- isIP() === 6 → "IPv6"
- isIP() === 0 → undefined (defensive, matches Node.js behavior for
  non-IP addresses, though not practically reachable via TCP server APIs)

Refs:
- nodejs/node#43054
- nodejs/node@70b516e

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Tango992 added a commit to denoland/deno that referenced this pull request Dec 6, 2025
## Summary

Aligns Deno's Node.js compatibility layer (`node:net`, `node:http`,
`node:https`,
`node:http2`, `node:dns`) with Node.js v18.4.0+ behavior by returning
the `family`
property as a string (`"IPv4"` or `"IPv6"`) rather than a number in
`server.address()`
   and socket address methods.

Node.js briefly changed `family` from string to number in v18.0.0
(nodejs/node#41431),
   but reverted in v18.4.0 (nodejs/node#43054) due to ecosystem breakage
   (nodejs/node#43014).

This fix ensures compatibility with npm packages that rely on the string
format, which
   has been the stable API since Node.js v18.4.0.

   ## Changes

- Modified `ext/node/polyfills/http.ts` to add `family` property to
`address()` return
- Modified `ext/node/polyfills/internal_binding/tcp_wrap.ts` to return
string `family`
instead of number in `getsockname()`, `getpeername()`, and `#connect()`
- Modified `ext/node/polyfills/net.ts` to fix `socket.remoteFamily`
getter (no longer
   needs conversion since `family` is now a string)
   - Modified `ext/node/polyfills/dns.ts` and
`ext/node/polyfills/internal/dns/promises.ts` to accept string family
values (`"IPv4"`,
`"IPv6"`) in `lookup()`, matching [Node.js
behavior](https://nodejs.org/api/dns.html#dnslookuphostname-options-callback)
- Added tests in `tests/unit_node/http_test.ts`,
`tests/unit_node/http2_test.ts`,
   `tests/unit_node/https_test.ts`, `tests/unit_node/dns_test.ts`, and
   `tests/unit_node/net_test.ts`

   ## Node.js Compatibility Note

For non-IP addresses (when `isIP()` returns 0), the `family` property is
`undefined`.
This matches Node.js C++ behavior in
[`AddressToJS`](https://github.com/nodejs/node/blob/main/src/tcp_wrap.cc)
where family
is only set for `AF_INET` (`"IPv4"`) and `AF_INET6` (`"IPv6"`), and left
undefined
   otherwise.

   ## Refs

   - nodejs/node#43054
   - nodejs/node@70b516e


<!--
Before submitting a PR, please read
https://docs.deno.com/runtime/manual/references/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't
run
   all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench'
label.
-->

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: Daniel Rahmanto <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. notable-change PRs with changes that should be highlighted in changelogs. semver-minor PRs that contain new features and should be released in the next minor version. tsc-agenda Issues and PRs to discuss during the meetings of the TSC.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Revert the change of network interfaces family from String to Integer