diagnostics_channel: revoke DEP0163

PR-URL: https://github.com/nodejs/node/pull/59758
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
This commit is contained in:
René
2025-09-08 16:34:52 +01:00
committed by GitHub
parent 2a99210ff7
commit 745e6c2012
2 changed files with 25 additions and 20 deletions

View File

@@ -3403,6 +3403,9 @@ Convert them to primitive strings.
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/59758
description: Deprecation revoked.
- version:
- v18.7.0
- v16.17.0
@@ -3410,14 +3413,12 @@ changes:
description: Documentation-only deprecation.
-->
Type: Documentation-only
Type: Deprecation revoked
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.
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
@@ -4151,8 +4152,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

View File

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