Skip to content

Lower generators in Hermes development profiles - #58255

Open
OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:codex/fix-hermes-dev-regenerator
Open

Lower generators in Hermes development profiles#58255
OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:codex/fix-hermes-dev-regenerator

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary:

Hermes stable/canary development profiles intend to lower generators for debugger compatibility, but enableRegenerator is currently passed only to @babel/plugin-transform-runtime. That replaces runtime references but does not lower generator syntax, so dev output still contains native function* declarations.

Run @babel/plugin-transform-regenerator explicitly for those development profiles. Async and destructuring preservation experiments take precedence: standalone regenerator otherwise overrides preserved async syntax and crashes on generator-local destructuring when runtime helpers are disabled.

Changelog:

[INTERNAL] [FIXED] - Lower generators in Hermes development profiles while respecting syntax-preservation experiments.

Test Plan:

  • Added a stable-dev regression proving a generator is lowered and uses @babel/runtime/regenerator; exact baseline retains function*.
  • Added no-runtime regressions proving explicit async/destructuring preservation remains intact and no longer crashes.
  • Regenerated the four affected dev fixtures through the repository's snapshot update path; preserve-async/destructuring fixtures remain unchanged.
  • Full preset Jest passes: 4/4 suites, 113/113 tests, 16 snapshots.
  • Fresh Flow check reports 0 errors; targeted no-ignore ESLint, Prettier, and git diff --check pass.
  • An exhaustive 384-combination profile/dev/preservation/runtime/module matrix leaves no regenerator/destructuring failures.

Compatibility / breaking changes

Development transform output intentionally changes to match the preset's existing debugger-compatibility policy. Production output and explicit async/destructuring preservation behavior are unchanged; there is no public API break.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 31, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant