From d621b63ef38893cb9869430b27c24702a7ae9f9d Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Thu, 4 Sep 2025 14:24:30 +0100 Subject: [PATCH] diagnostics_channel: revoke DEP0163 --- doc/api/deprecations.md | 17 ++++++++--------- doc/api/diagnostics_channel.md | 28 +++++++++++++++++----------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 9bdfb5fcf9621f..fd4baa6bf4394a 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -3403,6 +3403,9 @@ Convert them to primitive strings. -Type: Documentation-only - -These methods were deprecated because they can be used in a way which does not -hold the channel reference alive long enough to receive the events. +Type: Deprecation revoked -Use [`diagnostics_channel.subscribe(name, onMessage)`][] or -[`diagnostics_channel.unsubscribe(name, onMessage)`][] which does the same -thing instead. +These methods were deprecated because their use could leave the channel object +vulnerable to being garbage-collected if not strongly referenced by the user. +The deprecation was revoked because channel objects are now resistant to +garbage collection when the channel has active subscribers. ### DEP0164: `process.exit(code)`, `process.exitCode` coercion to integer @@ -4148,8 +4149,6 @@ an internal nodejs implementation rather than a public facing API, use `node:htt [`crypto.setEngine()`]: crypto.md#cryptosetengineengine-flags [`decipher.final()`]: crypto.md#decipherfinaloutputencoding [`decipher.setAuthTag()`]: crypto.md#deciphersetauthtagbuffer-encoding -[`diagnostics_channel.subscribe(name, onMessage)`]: diagnostics_channel.md#diagnostics_channelsubscribename-onmessage -[`diagnostics_channel.unsubscribe(name, onMessage)`]: diagnostics_channel.md#diagnostics_channelunsubscribename-onmessage [`dirent.parentPath`]: fs.md#direntparentpath [`dns.lookup()`]: dns.md#dnslookuphostname-options-callback [`dnsPromises.lookup()`]: dns.md#dnspromiseslookuphostname-options diff --git a/doc/api/diagnostics_channel.md b/doc/api/diagnostics_channel.md index 1c742f7f972ce0..b5be9c02f96312 100644 --- a/doc/api/diagnostics_channel.md +++ b/doc/api/diagnostics_channel.md @@ -373,13 +373,17 @@ channel.publish({ added: - v15.1.0 - v14.17.0 -deprecated: - - v18.7.0 - - v16.17.0 +changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/59758 + description: Deprecation revoked. + - version: + - v18.7.0 + - v16.17.0 + pr-url: https://github.com/nodejs/node/pull/44943 + description: Documentation-only deprecation. --> -> Stability: 0 - Deprecated: Use [`diagnostics_channel.subscribe(name, onMessage)`][] - * `onMessage` {Function} The handler to receive channel messages * `message` {any} The message data * `name` {string|symbol} The name of the channel @@ -414,10 +418,15 @@ channel.subscribe((message, name) => { added: - v15.1.0 - v14.17.0 -deprecated: - - v18.7.0 - - v16.17.0 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/59758 + description: Deprecation revoked. + - version: + - v18.7.0 + - v16.17.0 + pr-url: https://github.com/nodejs/node/pull/44943 + description: Documentation-only deprecation. - version: - v17.1.0 - v16.14.0 @@ -426,8 +435,6 @@ changes: description: Added return value. Added to channels without subscribers. --> -> Stability: 0 - Deprecated: Use [`diagnostics_channel.unsubscribe(name, onMessage)`][] - * `onMessage` {Function} The previous subscribed handler to remove * Returns: {boolean} `true` if the handler was found, `false` otherwise. @@ -1423,7 +1430,6 @@ Emitted when a new thread is created. [`diagnostics_channel.channel(name)`]: #diagnostics_channelchannelname [`diagnostics_channel.subscribe(name, onMessage)`]: #diagnostics_channelsubscribename-onmessage [`diagnostics_channel.tracingChannel()`]: #diagnostics_channeltracingchannelnameorchannels -[`diagnostics_channel.unsubscribe(name, onMessage)`]: #diagnostics_channelunsubscribename-onmessage [`end` event]: #endevent [`error` event]: #errorevent [`net.Server.listen()`]: net.md#serverlisten