Skip to content

Support transforming async generators like @babel/plugin-proposal-async-generator-functions does #2780

Closed
@segevfiner

Description

It would be nice to be able to have esbuild transform async generators like the babel plugin @babel/plugin-proposal-async-generator-functions does when native async support is disabled, that is:

   esbuild: {
     supported: {
       "async-await": false,
     }
  }

Currently using async generator functions with async await disabled results in an error.

This is used as a stopgap by Angular's Zone.JS so they can track async generator functions as they have no way to track native async await in the browser ATM, so they rely on down transpiling them to generators.

See: https://github.com/angular/angular-cli/blob/67ffa8b40be04b0e671429063810fe5f52b2043a/packages/angular_devkit/build_angular/src/babel/presets/application.ts#L232-L239

If esbuild supported this natively, babel wouldn't be needed here.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions