FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

doc: recommend queueMicrotask over process.nextTick by jasnell · Pull Request #37484 · nodejs/node · GitHub

/ node Public

doc: recommend queueMicrotask over process.nextTick - #37484

Closed
jasnell wants to merge 1 commit into
nodejs:masterfrom
jasnell:recommend-queuemicrotask
Closed

doc: recommend queueMicrotask over process.nextTick#37484
jasnell wants to merge 1 commit into
nodejs:masterfrom
jasnell:recommend-queuemicrotask

Conversation

jasnell commented Feb 22, 2021

Copy link
Copy Markdown
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 jasnell@gmail.com
Fixes: #36870

nodejs-github-bot added doc Issues and PRs related to the documentations. process Issues and PRs related to the process subsystem. labels Feb 22, 2021
Comment thread doc/api/process.md Outdated

mscdex commented Feb 23, 2021

Copy link
Copy Markdown
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 commented Feb 23, 2021

Copy link
Copy Markdown
Member Author

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.

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

Comment thread doc/api/process.md Outdated
We likely cannot ever deprecate process.nextTick, but we can start
steering people towards queueMicrotask for most cases.

Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: nodejs#36870
jasnell force-pushed the recommend-queuemicrotask branch from e4c86c3 to 02f32c6 Compare February 23, 2021 15:11

jasnell commented Feb 23, 2021

Copy link
Copy Markdown
Member Author

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

jasnell added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Feb 23, 2021
ronag added a commit to nodejs/undici that referenced this pull request Feb 24, 2021
Comment thread doc/api/process.md

jasnell commented Feb 25, 2021

Copy link
Copy Markdown
Member Author

Landed in ee6c467

jasnell 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 <jasnell@gmail.com>
Fixes: #36870

PR-URL: #37484
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
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 <jasnell@gmail.com>
Fixes: #36870

PR-URL: #37484
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
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 <jasnell@gmail.com>
Fixes: #36870

PR-URL: #37484
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
danielleadams mentioned this pull request May 3, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. doc Issues and PRs related to the documentations. process Issues 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


Back | FazBrowse Home | New Git URL