fix: Remove usage of experimental API#89
Conversation
|
So for thr history, it was added bc everyone begged for it to be added because I guess there are tracing and other libs that use async hooks so such and this was required so the context was not lost. There is a test for this in our test suite, which of course now fails with this removal. I don't think we can just remove this unless the ecosystem as a whole moves away from using whatever these modules are for tracing. |
|
I looked at the Node.js docs and the Node.js PR you referenced and it seems that |
|
Not entirely sure how to fix it. @Qard, do you mind taking a look if you have time? You probably understand these APIs better than I do. |
|
Ah, yeah, AsyncResource is stable and this is still required for AsyncLocalStorage to function correctly. This can't be removed. Any time callbacks are delayed or deferred in some way there will need to be AsyncResource to connect the callback to where the task originated. |
|
Got it, thanks for the insight! |
Node.js has moved async hooks to
experimentalstatus, and it's use is strongly discouraged now. I don't entirely understand why async hooks is needed here, so I just removed it entirely. This should yield a decent performance improvement, as async hooks is known to have a lot of overhead.See nodejs/node#45369.