Skip to content

process: add process.ref() and process.unref() methods#56400

Closed
jasnell wants to merge 1 commit into
nodejs:mainfrom
jasnell:process-ref-unref
Closed

process: add process.ref() and process.unref() methods#56400
jasnell wants to merge 1 commit into
nodejs:mainfrom
jasnell:process-ref-unref

Conversation

@jasnell
Copy link
Copy Markdown
Member

@jasnell jasnell commented Dec 29, 2024

The process.ref(...) and process.unref(...) methods are intended to replace the use of ref() and unref() methods defined directly on individual API objects. The existing ref() and unref() methods will be marked as legacy and won't be removed but new APIs should use process.ref() and process.unref() instead.

Refs: #53266

The `process.ref(...)` and `process.unref(...)` methods are intended
to replace the use of `ref()` and `unref()` methods defined directly
on individual API objects. The existing `ref()` and `unref()` methods
will be marked as legacy and won't be removed but new APIs should use
`process.ref()` and `process.unref()` instead.

Refs: nodejs#53266
@jasnell jasnell requested review from anonrig and mcollina December 29, 2024 17:45
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/startup

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem. labels Dec 29, 2024
@nodejs-github-bot

This comment was marked as outdated.

Copy link
Copy Markdown
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

@codecov

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@jasnell jasnell added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed needs-ci PRs that need a full CI run. labels Dec 30, 2024
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

nodejs-github-bot commented Dec 31, 2024

@jasnell jasnell added the semver-minor PRs that contain new features and should be released in the next minor version. label Dec 31, 2024
jasnell added a commit that referenced this pull request Dec 31, 2024
The `process.ref(...)` and `process.unref(...)` methods are intended
to replace the use of `ref()` and `unref()` methods defined directly
on individual API objects. The existing `ref()` and `unref()` methods
will be marked as legacy and won't be removed but new APIs should use
`process.ref()` and `process.unref()` instead.

Refs: #53266
PR-URL: #56400
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
@jasnell
Copy link
Copy Markdown
Member Author

jasnell commented Dec 31, 2024

Landed in 35742a2

@jasnell jasnell closed this Dec 31, 2024
aduh95 pushed a commit that referenced this pull request Jan 2, 2025
The `process.ref(...)` and `process.unref(...)` methods are intended
to replace the use of `ref()` and `unref()` methods defined directly
on individual API objects. The existing `ref()` and `unref()` methods
will be marked as legacy and won't be removed but new APIs should use
`process.ref()` and `process.unref()` instead.

Refs: #53266
PR-URL: #56400
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
nodejs-github-bot added a commit that referenced this pull request Jan 3, 2025
Notable changes:

lib:
  * (SEMVER-MINOR) add typescript support to STDIN eval (Marco Ippolito) #56359
module:
  * (SEMVER-MINOR) unflag --experimental-strip-types (Marco Ippolito) #56350
process:
  * (SEMVER-MINOR) add process.ref() and process.unref() methods (James M Snell) #56400
worker:
  * (SEMVER-MINOR) add eval ts input (Marco Ippolito) #56394

PR-URL: #56450
marco-ippolito pushed a commit that referenced this pull request Jan 3, 2025
Notable changes:

lib:
  * (SEMVER-MINOR) add typescript support to STDIN eval (Marco Ippolito) #56359
module:
  * (SEMVER-MINOR) unflag --experimental-strip-types (Marco Ippolito) #56350
process:
  * (SEMVER-MINOR) add process.ref() and process.unref() methods (James M Snell) #56400
worker:
  * (SEMVER-MINOR) add eval ts input (Marco Ippolito) #56394

PR-URL: #56450
marco-ippolito pushed a commit that referenced this pull request Jan 7, 2025
Notable changes:

lib:
  * (SEMVER-MINOR) add typescript support to STDIN eval (Marco Ippolito) #56359
module:
  * (SEMVER-MINOR) unflag --experimental-strip-types (Marco Ippolito) #56350
process:
  * (SEMVER-MINOR) add process.ref() and process.unref() methods (James M Snell) #56400
worker:
  * (SEMVER-MINOR) add eval ts input (Marco Ippolito) #56394

PR-URL: #56450
Comment thread doc/api/process.md

An object is "refable" if it implements the Node.js "Refable protocol".
Specifically, this means that the object implements the `Symbol.for('node:ref')`
and `Symbol.for('node:unref')` methods. "Ref'd" objects will keep the Node.js
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@jasnell All other Node.js symbols use nodejs. as the prefix rather than node:. Can we fix that up here as well before it gets released?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah damn, it already is released. Welp.

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jan 8, 2025