Skip to content

Conversation

@jasnell
Copy link
Member

We likely cannot ever deprecate process.nextTick, but we can start
steering people towards queueMicrotask for most cases.

Signed-off-by: James M Snell [email protected]
Fixes: #36870

@nodejs-github-botnodejs-github-bot added doc Issues and PRs related to the documentations. process Issues and PRs related to the process subsystem. labels Feb 22, 2021
@mscdex
Copy link
Contributor

I think one obvious (and probably note-worthy) incompatibility compared to process.nextTick() is that you cannot pass values to the callback, something node core takes advantage of extensively for convenience and performance.

@jasnell
Copy link
MemberAuthor

I think one obvious (and probably note-worthy) incompatibility compared to process.nextTick() is that you cannot pass values to the callback, something node core takes advantage of extensively for convenience and performance.

Good point and definitely worth adding.

@Delapouite
Copy link
Contributor

Should queueMicrotask be also mentioned in this documentation page about the event loop: https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/ ?

We likely cannot ever deprecate process.nextTick, but we can start steering people towards queueMicrotask for most cases. Signed-off-by: James M Snell <[email protected]> Fixes: nodejs#36870
@jasnelljasnellforce-pushed the recommend-queuemicrotask branch from e4c86c3 to 02f32c6CompareFebruary 23, 2021 15:11
@jasnell
Copy link
MemberAuthor

@Delapouite ... yes, but that's a separate change.

@jasnelljasnell added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 23, 2021
ronag added a commit to nodejs/undici that referenced this pull request Feb 24, 2021
@jasnell
Copy link
MemberAuthor

Landed in ee6c467

@jasnelljasnell closed this Feb 25, 2021
jasnell added a commit that referenced this pull request Feb 25, 2021
We likely cannot ever deprecate process.nextTick, but we can start steering people towards queueMicrotask for most cases. Signed-off-by: James M Snell <[email protected]> Fixes: #36870 PR-URL: #37484 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
targos pushed a commit that referenced this pull request Feb 28, 2021
We likely cannot ever deprecate process.nextTick, but we can start steering people towards queueMicrotask for most cases. Signed-off-by: James M Snell <[email protected]> Fixes: #36870 PR-URL: #37484 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
@targostargos mentioned this pull request Mar 2, 2021
targos pushed a commit that referenced this pull request May 1, 2021
We likely cannot ever deprecate process.nextTick, but we can start steering people towards queueMicrotask for most cases. Signed-off-by: James M Snell <[email protected]> Fixes: #36870 PR-URL: #37484 Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
@danielleadamsdanielleadams mentioned this pull request May 3, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.docIssues and PRs related to the documentations.processIssues and PRs related to the process subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate process.nextTick in favor of queueMicrotask

8 participants

@jasnell@mscdex@Delapouite@martinheidegger@ronag@devsnek@marsonya@nodejs-github-bot