lib: rewrite AsyncLocalStorage without async_hooks by Qard · Pull Request #48528 · nodejs/node

That's not quite accurate as run/enterWith will enable it again automatically. The existing disable also doesn't actually change the value stored on the associated resource so, for example, you could call disable() and then follow it with a run() and the previously entered context before the disable would be restored after the run() exits, which is kind of a bug. I'm intentionally leaving the existing ALS behaviour as-is, despite having several bugs. Those incorrect behaviours can be fixed in follow-up PRs.

The API is also considered experimental, so can be changed at any time. Support for the existing experimental APIs is somewhat best-effort and I would prefer to deprecate these APIs entirely unless some specific effort goes into fixing and stabilizing these APIs.

I don't think exact bug-for-bug reproduction of the existing ALS should be a goal here. The stabilized parts should be expected to behave the same, but the rest is best effort and likely to deviate a bit as the new model allows fixing some issues in the design of the prior model.