-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
doc: stabilize AsyncLocalStorage methods #58019
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
base: main
Are you sure you want to change the base?
Conversation
Mark AsyncLocalStorage#enterWith and AsyncLocalStorage#disable as stable
As far as I remember it was not marked as stable for following reasons:
Having these APIs stable and getting native JS support for |
@@ -215,7 +215,7 @@ added: | |||
- v12.17.0 | |||
--> | |||
|
|||
> Stability: 1 - Experimental | |||
> Stability: 2 - Stable |
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 think we should mention the version when it was moved from experimental to stable in the YAML section above.
see e.g. AsyncLocalStorage.snapshot()
as reference.
We can't remove them either because they are needed for the instrumentation/apm use case as well as many frameworks. You can see examples in: nodejs/standards-positions#2 (comment). We should mark those as stable, or remove them entirely if an alternative can be identified. |
Sorry, my intention was not to block this. I was in favor of a simple I guess the best extension to What I still don't like is the name - Another question: Any reason why While writing this I remembered that |
No worried, I did not read it this way, also, I opened this PR to re-open the discussion! I like the idea of using cc @legendecas |
Comparing to async function foo() {
als.enterWith(newValue);
await 0;
} If It's fair to say that an experimental API has been used a lot and it should be promote to stable, but it should also be documented in which case it will break as caveats. That's been said, I think |
Mark AsyncLocalStorage#enterWith and AsyncLocalStorage#disable as stable
Following discussions with @mcollina , I don't remember fully why these two methods are now stable.
They might be confusing for the end user to know which context they are in but now that async context tracking is more well known, I don't think this is so much of a big problem?