Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
async_hooks: make AsyncResource safer #18513
User code ends up becoming significantly safer, and cleaner as a result of the change here. Several foot guns have been removed.
N-API folks added a counterpart to this API which doesn't suffer from these foot-guns, and offers a
Given the very strong likelihood of foot-gun in the user code using the existing API, this PR runtime deprecates the dangerous APIs while providing a safe alternative. Since async-hooks is experimental, landing this would be semver-minor. This can be back-ported to 8.x and 9.x.
I have a very hard time imagining valid use-cases that this might break, but I am willing to be educated.
Affected core subsystem(s)
Yes, this is much better.
Previously we have done that by first making a semver-minor PR that adds the depreciation and then follow that up with a semver-major PR that removes the deprecated API.
@addaleax @AndreasMadsen I like those names