-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: remove "idiomatic choice" from queueMicrotask #23885
Conversation
doc/api/globals.md
Outdated
@@ -122,7 +122,6 @@ The `queueMicrotask()` method queues a microtask to invoke `callback`. If | |||
`callback` throws an exception, the [`process` object][] `'uncaughtException'` | |||
event will be emitted. | |||
|
|||
In general, `queueMicrotask` is the idiomatic choice over `process.nextTick()`. | |||
`process.nextTick()` will always run before the microtask queue, and so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, this whole paragraph is kinda sketchy. There is nothing unexpected about the nextTick execution order. As for Node 10 it is entirely predictable and defined, with no weird edge cases. It might not be "desired" but that's up to the individual user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be wrong, but the transition from the previous paragraph to the process.nextTick()
mention seems a bit abrupt and unexpected now. Maybe we can add some smooth connection? Like On the other hand...
, Similar `process.nextTick()`...
etc?
It can't be idiomatic if it's not in general use and therefore hasn't been picked up by users. It's not even in browsers yet. "Idiomatic" use is an emergent property that comes from observed use and this feature is so new (to browsers and Node) that it can't possibly be. In general I don't think it's the place of the Node API docs to observe what emerges as idiomatic Node.js. It also can't be a recommended feature (if that was the intent of the language) because it's marked experimental. For now, it's just a feature, nothing more. Recommendations and/or observations about it being 'idiomatic' can come later.
d1fd048
to
999ddf4
Compare
999ddf4
to
a6da5fd
Compare
@apapirovski & @vsemozhetbyt good point on the flow into that second paragraph. I've expanded it to be a bit more helpful and the latest commit reads:
Thoughts? |
It can't be idiomatic if it's not in general use and therefore hasn't been picked up by users. It's not even in browsers yet. "Idiomatic" use is an emergent property that comes from observed use and this feature is so new (to browsers and Node) that it can't possibly be. In general I don't think it's the place of the Node API docs to observe what emerges as idiomatic Node.js. It also can't be a recommended feature (if that was the intent of the language) because it's marked experimental. For now, it's just a feature, nothing more. Recommendations and/or observations about it being 'idiomatic' can come later. PR-URL: #23885 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
It can't be idiomatic if it's not in general use and therefore hasn't been picked up by users. It's not even in browsers yet. "Idiomatic" use is an emergent property that comes from observed use and this feature is so new (to browsers and Node) that it can't possibly be. In general I don't think it's the place of the Node API docs to observe what emerges as idiomatic Node.js. It also can't be a recommended feature (if that was the intent of the language) because it's marked experimental. For now, it's just a feature, nothing more. Recommendations and/or observations about it being 'idiomatic' can come later. PR-URL: #23885 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
It can't be idiomatic if it's not in general use and therefore hasn't
been picked up by users. It's not even in browsers yet.
"Idiomatic" use is an emergent property that comes from observed use
and this feature is so new (to browsers and Node) that it can't
possibly be. In general I don't think it's the place of the Node API
docs to observe what emerges as idiomatic Node.js.
It also can't be a recommended feature (if that was the intent of the
language) because it's marked experimental. For now, it's just a
feature, nothing more. Recommendations and/or observations about it
being 'idiomatic' can come later.