Skip to content
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

TC39 AsyncContext Integration #10432

Open
2 tasks
legendecas opened this issue Jun 25, 2024 · 1 comment
Open
2 tasks

TC39 AsyncContext Integration #10432

legendecas opened this issue Jun 25, 2024 · 1 comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest

Comments

@legendecas
Copy link

legendecas commented Jun 25, 2024

What problem are you trying to solve?

TC39 stage 2 proposal AsyncContext adds new built-in APIs to propagate data through logically-connected sync/async code execution. It will need HTML/Web API integration to properly save and restore context data at the boundary of asynchronous call contexts, e.g. timers, event listeners, and observers.

  • Define specification infrastructure
  • ...

What solutions exist today?

The solution is not yet complete, submitting this proposal to open a space for discussion in HTML.

How would you solve it?

The issue tc39/proposal-async-context#82 has iterated on various integration points that are essential on the web platform.

@legendecas legendecas added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest labels Jun 25, 2024
@littledan
Copy link
Contributor

The biggest thing we need to decide at the HTML level is, for each API which accepts callbacks, which AsyncContext.Snapshot should it be run in. Many of us are leaning towards "the snapshot where the callback-accepting API was first called".

Some Web APIs could benefit from passing an additional AsyncContext.Shapshot instance to the callback, e.g., it might be useful for window.onerror to have access to the current snapshot when the exception was thrown--this could be an attribute attached to the Event, or the Error/DOMException, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest
Development

No branches or pull requests

2 participants