Repository navigation
async_hooks: runtime deprecate createHook() - #67271
Conversation
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #67271 +/- ##
=======================================
Coverage 90.57% 90.57%
=======================================
Files 802 802
Lines 286862 286926 +64
Branches 55403 55401 -2
=======================================
+ Hits 259821 259884 +63
Misses 17132 17132
- Partials 9909 9910 +1
🚀 New features to boost your workflow:
|
joyeecheung
left a comment
There was a problem hiding this comment.
Code LGTM, thanks, with a comment on an unnecessary test
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
This pull request has conflicts with its base branch, removing the |
Commit Queue failed
The pull request was removed from the Commit Queue and labeled
commit-queue-failed
Full Commit Queue output |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Can you rebase it? |
52aa301 to
b319809
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
The
notable-change
Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section. |
Commit Queue failed
The pull request was removed from the Commit Queue and labeled
commit-queue-failed
Full Commit Queue output |
Emit DEP0215 when async_hooks.createHook() is called, as the first step before putting it behind a flag. The inspector and the node.async_hooks trace event category use an internal createHook() and do not emit the warning. Refs: nodejs#61030 Signed-off-by: Matteo Collina <hello@matteocollina.com> Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com> Assisted-by: OpenAI
b319809 to
c22b433
Compare
|
Landed in 62ebcbe |
async_hooks.createHook()now emits a DEP0212 deprecation warning. This is the first step of the deprecation cycle suggested in #61030 (comment): warn in the 27 alpha, then require--enable-async-hooksin 27 current.The public
AsyncHookclass is unchanged. The inspector and thenode.async_hookstrace event category switch to a minimalInternalAsyncHookininternal/async_hooks, so enabling them does not emit the warning. Trace events still track promises (it emits thePROMISEevents from JavaScript), so that is now covered intest-trace-events-async-hooks.js.Printing the warning schedules a tick that a freshly enabled hook sees without a matching
init, so the tests that check exact hook invocations now run with--no-deprecation.Refs: #61030