GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: recommend queueMicrotask over process.nextTick by jasnell · Pull Request #37484 · nodejs/node

Conversation

@jasnell

@jasnell 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 [email protected]
Fixes: #36870

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ChALkeR, tjallingt, and bricss reacted with thumbs up emoji
All reactions
  • 👍 3 reactions
@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to Node.js documentation. process Issues and PRs related to the process subsystem. labels Feb 22, 2021
@jasnell jasnell mentioned this pull request Feb 22, 2021
Deprecate process.nextTick in favor of queueMicrotask #36870
Closed
devsnek
devsnek approved these changes Feb 22, 2021
View reviewed changes
mscdex
mscdex reviewed Feb 23, 2021
View reviewed changes
Comment thread doc/api/process.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mscdex

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Delapouite

Delapouite commented Feb 23, 2021

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/ ?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ronag
ronag reviewed Feb 23, 2021
View reviewed changes
Comment thread doc/api/process.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jasnell
doc: recommend queueMicrotask over process.nextTick
02f32c6
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
@jasnell
jasnell force-pushed the recommend-queuemicrotask branch from e4c86c3 to 02f32c6 Compare February 23, 2021 15:11
@jasnell

jasnell commented Feb 23, 2021

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Feb 23, 2021
ronag added a commit to nodejs/undici that referenced this pull request Feb 24, 2021
@ronag
fix: use queueMicrotask
5ca97d6
Fixes: #562
Refs: nodejs/node#37484
marsonya
marsonya approved these changes Feb 24, 2021
View reviewed changes
martinheidegger
martinheidegger reviewed Feb 24, 2021
View reviewed changes
Comment thread doc/api/process.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

ronag
ronag approved these changes Feb 25, 2021
View reviewed changes
@jasnell

jasnell commented Feb 25, 2021

Copy link
Copy Markdown
Member Author

Landed in ee6c467

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell closed this Feb 25, 2021
jasnell added a commit that referenced this pull request Feb 25, 2021
@jasnell
doc: recommend queueMicrotask over process.nextTick
ee6c467
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
@jasnell @targos
doc: recommend queueMicrotask over process.nextTick
4a40759
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 targos mentioned this pull request Mar 2, 2021
v15.11.0 release proposal #37569
Merged
targos pushed a commit that referenced this pull request May 1, 2021
@jasnell @targos
doc: recommend queueMicrotask over process.nextTick
2082f5b
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]>
@danielleadams danielleadams mentioned this pull request May 3, 2021
v14.17.0 proposal #38507
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ronag ronag ronag approved these changes
@marsonya marsonya marsonya approved these changes
+3 more reviewers
@mscdex mscdex mscdex left review comments
@martinheidegger martinheidegger martinheidegger left review comments
@devsnek devsnek devsnek approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. doc Issues and PRs related to Node.js documentation. process Issues and PRs related to the process subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Deprecate process.nextTick in favor of queueMicrotask

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@jasnell @mscdex @Delapouite @martinheidegger @ronag @devsnek @marsonya @nodejs-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.