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

Improve documentation about the Zone.js async/await issue #5104

Open
1 of 2 tasks
segevfiner opened this issue Nov 1, 2024 · 0 comments
Open
1 of 2 tasks

Improve documentation about the Zone.js async/await issue #5104

segevfiner opened this issue Nov 1, 2024 · 0 comments

Comments

@segevfiner
Copy link

  • This only affects the JavaScript OpenTelemetry library
  • This may affect other libraries, but I would like to get opinions here first

Zone.js which is used for context management in the browser fails to maintain context across async/await syntax. The docs currently state that you have to transpile to ES2015 to get it to work. But in actuality you only need to transpile down async/await and async generators syntax AFAIK. For example using esbuild's supported.{async-await,async-genetator} options, or using a Babel plugin. Which is what the Angular CLI does.

In general Zone.js is not perfect and can cause a performance hit in some cases, so hopefully sometime in our lifetime, native async context will be available in the browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant