Skip to content

Commit 745e6c2

Browse files
authored
diagnostics_channel: revoke DEP0163
PR-URL: #59758 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Stephen Belanger <[email protected]>
1 parent 2a99210 commit 745e6c2

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

doc/api/deprecations.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3403,21 +3403,22 @@ Convert them to primitive strings.
34033403

34043404
<!-- YAML
34053405
changes:
3406+
- version: REPLACEME
3407+
pr-url: https://github.com/nodejs/node/pull/59758
3408+
description: Deprecation revoked.
34063409
- version:
34073410
- v18.7.0
34083411
- v16.17.0
34093412
pr-url: https://github.com/nodejs/node/pull/42714
34103413
description: Documentation-only deprecation.
34113414
-->
34123415

3413-
Type: Documentation-only
3414-
3415-
These methods were deprecated because they can be used in a way which does not
3416-
hold the channel reference alive long enough to receive the events.
3416+
Type: Deprecation revoked
34173417

3418-
Use [`diagnostics_channel.subscribe(name, onMessage)`][] or
3419-
[`diagnostics_channel.unsubscribe(name, onMessage)`][] which does the same
3420-
thing instead.
3418+
These methods were deprecated because their use could leave the channel object
3419+
vulnerable to being garbage-collected if not strongly referenced by the user.
3420+
The deprecation was revoked because channel objects are now resistant to
3421+
garbage collection when the channel has active subscribers.
34213422

34223423
### DEP0164: `process.exit(code)`, `process.exitCode` coercion to integer
34233424

@@ -4151,8 +4152,6 @@ an internal nodejs implementation rather than a public facing API, use `node:htt
41514152
[`crypto.setEngine()`]: crypto.md#cryptosetengineengine-flags
41524153
[`decipher.final()`]: crypto.md#decipherfinaloutputencoding
41534154
[`decipher.setAuthTag()`]: crypto.md#deciphersetauthtagbuffer-encoding
4154-
[`diagnostics_channel.subscribe(name, onMessage)`]: diagnostics_channel.md#diagnostics_channelsubscribename-onmessage
4155-
[`diagnostics_channel.unsubscribe(name, onMessage)`]: diagnostics_channel.md#diagnostics_channelunsubscribename-onmessage
41564155
[`dirent.parentPath`]: fs.md#direntparentpath
41574156
[`dns.lookup()`]: dns.md#dnslookuphostname-options-callback
41584157
[`dnsPromises.lookup()`]: dns.md#dnspromiseslookuphostname-options

doc/api/diagnostics_channel.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,17 @@ channel.publish({
373373
added:
374374
- v15.1.0
375375
- v14.17.0
376-
deprecated:
377-
- v18.7.0
378-
- v16.17.0
376+
changes:
377+
- version: REPLACEME
378+
pr-url: https://github.com/nodejs/node/pull/59758
379+
description: Deprecation revoked.
380+
- version:
381+
- v18.7.0
382+
- v16.17.0
383+
pr-url: https://github.com/nodejs/node/pull/44943
384+
description: Documentation-only deprecation.
379385
-->
380386

381-
> Stability: 0 - Deprecated: Use [`diagnostics_channel.subscribe(name, onMessage)`][]
382-
383387
* `onMessage` {Function} The handler to receive channel messages
384388
* `message` {any} The message data
385389
* `name` {string|symbol} The name of the channel
@@ -414,10 +418,15 @@ channel.subscribe((message, name) => {
414418
added:
415419
- v15.1.0
416420
- v14.17.0
417-
deprecated:
418-
- v18.7.0
419-
- v16.17.0
420421
changes:
422+
- version: REPLACEME
423+
pr-url: https://github.com/nodejs/node/pull/59758
424+
description: Deprecation revoked.
425+
- version:
426+
- v18.7.0
427+
- v16.17.0
428+
pr-url: https://github.com/nodejs/node/pull/44943
429+
description: Documentation-only deprecation.
421430
- version:
422431
- v17.1.0
423432
- v16.14.0
@@ -426,8 +435,6 @@ changes:
426435
description: Added return value. Added to channels without subscribers.
427436
-->
428437

429-
> Stability: 0 - Deprecated: Use [`diagnostics_channel.unsubscribe(name, onMessage)`][]
430-
431438
* `onMessage` {Function} The previous subscribed handler to remove
432439
* Returns: {boolean} `true` if the handler was found, `false` otherwise.
433440

@@ -1423,7 +1430,6 @@ Emitted when a new thread is created.
14231430
[`diagnostics_channel.channel(name)`]: #diagnostics_channelchannelname
14241431
[`diagnostics_channel.subscribe(name, onMessage)`]: #diagnostics_channelsubscribename-onmessage
14251432
[`diagnostics_channel.tracingChannel()`]: #diagnostics_channeltracingchannelnameorchannels
1426-
[`diagnostics_channel.unsubscribe(name, onMessage)`]: #diagnostics_channelunsubscribename-onmessage
14271433
[`end` event]: #endevent
14281434
[`error` event]: #errorevent
14291435
[`net.Server.listen()`]: net.md#serverlisten

0 commit comments

Comments
 (0)