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

RN preset: support async iterators, for await of #747

Conversation

newyankeecodeshop
Copy link
Contributor

@newyankeecodeshop newyankeecodeshop commented Dec 4, 2021

Summary

Async Generators and for await are part of ES2018. This PR adds plugin-proposal-async-generator-functions to the react native preset.
See https://babeljs.io/docs/en/babel-plugin-proposal-async-generator-functions

Fixes #551

Test plan

I added a test transforms async generators to index-test.js.

@facebook-github-bot facebook-github-bot added 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. labels Dec 4, 2021
@newyankeecodeshop
Copy link
Contributor Author

Happy New Year @motiz88 are you able to review this?

@newyankeecodeshop
Copy link
Contributor Author

Hi @rh389 , can you or someone at Meta give this a look please? I'm happy to make changes or close it if you're not interested in metro including support for async iterators.

@robhogan
Copy link
Contributor

Pulling this in for a closer look - thanks!

@facebook-github-bot
Copy link
Contributor

@rh389 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

{
dev: true,
type: 'module',
unstable_transformProfile: 'hermes-stable',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this line and test the default transform profile instead? Alternatively we can have a separate test for hermes-stable, but the main test should exercise the default profile.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will do

@facebook-github-bot
Copy link
Contributor

@rh389 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

ericanderson added a commit to ericanderson/metro that referenced this pull request Feb 9, 2022
* upstream/main:
  Use node devtools url (facebook#761)
  Publish 0.68.0
  fix(website): add Algolia search API key (facebook#726)
  Change github actions trigger to use `main` branch (facebook#769)
  RN preset: support async iterators, for await of (facebook#747)
  Deploy 0.171.0 to xplat
nevilm-lt pushed a commit to nevilm-lt/metro that referenced this pull request Mar 14, 2022
Summary:
**Summary**

Async Generators and `for await` are part of ES2018. This PR adds `plugin-proposal-async-generator-functions` to the react native preset.
See https://babeljs.io/docs/en/babel-plugin-proposal-async-generator-functions

Fixes facebook#551

**Test plan**

I added a test `transforms async generators` to `index-test.js`.

Pull Request resolved: facebook#747

Reviewed By: motiz88

Differential Revision: D33621536

Pulled By: rh389

fbshipit-source-id: 0e07e6132e894fb5ad455627c2a33674f904a2fc
nevilm-lt pushed a commit to nevilm-lt/metro that referenced this pull request Apr 21, 2022
Summary:
**Summary**

Async Generators and `for await` are part of ES2018. This PR adds `plugin-proposal-async-generator-functions` to the react native preset.
See https://babeljs.io/docs/en/babel-plugin-proposal-async-generator-functions

Fixes facebook#551

**Test plan**

I added a test `transforms async generators` to `index-test.js`.

Pull Request resolved: facebook#747

Reviewed By: motiz88

Differential Revision: D33621536

Pulled By: rh389

fbshipit-source-id: 0e07e6132e894fb5ad455627c2a33674f904a2fc
nevilm-lt pushed a commit to nevilm-lt/metro that referenced this pull request Apr 22, 2022
Summary:
**Summary**

Async Generators and `for await` are part of ES2018. This PR adds `plugin-proposal-async-generator-functions` to the react native preset.
See https://babeljs.io/docs/en/babel-plugin-proposal-async-generator-functions

Fixes facebook#551

**Test plan**

I added a test `transforms async generators` to `index-test.js`.

Pull Request resolved: facebook#747

Reviewed By: motiz88

Differential Revision: D33621536

Pulled By: rh389

fbshipit-source-id: 0e07e6132e894fb5ad455627c2a33674f904a2fc
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.

Support for asynchronous iterators (async for of)
4 participants