Skip to content

Babel preset: keep lowering async generators with unstable_preserveAsync - #60577

Open
micleo2 wants to merge 1 commit into
react:mainfrom
micleo2:export-D136346510
Open

micleo2 wants to merge 1 commit into
react:mainfrom
micleo2:export-D136346510

Conversation

@micleo2

@micleo2 micleo2 commented Dec 4, 2026

Copy link
Copy Markdown

Summary:
unstable_preserveAsync now disables only babel/plugin-transform-async-to-generator. babel/plugin-transform-async-generator-functions keeps running, so async function* and for await inside async generators are still lowered, while plain async functions, arrows and methods keep native async/await.

Hermes compiles async generators only behind a compiler flag that is off by default, so preserving them makes bundle compilation fail with "async generators are unsupported" whenever an async generator is reachable from the entry point.

Changelog: [Internal]

Differential Revision: D136346510

Summary:
`unstable_preserveAsync` now disables only `babel/plugin-transform-async-to-generator`. `babel/plugin-transform-async-generator-functions` keeps running, so `async function*` and `for await` inside async generators are still lowered, while plain async functions, arrows and methods keep native `async`/`await`.

Hermes compiles async generators only behind a compiler flag that is off by default, so preserving them makes bundle compilation fail with "async generators are unsupported" whenever an async generator is reachable from the entry point.

Changelog: [Internal]

Differential Revision: D136346510
@meta-codesync

meta-codesync Bot commented Dec 4, 2026

Copy link
Copy Markdown

@micleo2 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D136346510.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant