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

Started using babel-preset-latest #490

Merged
merged 4 commits into from
Aug 25, 2016
Merged

Started using babel-preset-latest #490

merged 4 commits into from
Aug 25, 2016

Conversation

kripod
Copy link
Contributor

@kripod kripod commented Aug 25, 2016

No description provided.

@ghost ghost added the CLA Signed label Aug 25, 2016
@gaearon
Copy link
Contributor

gaearon commented Aug 25, 2016

What about async/await? Do we have the right combination of plugins for it after this change?

@kripod
Copy link
Contributor Author

kripod commented Aug 25, 2016

According to the source code of babel-preset-es2017, it transforms async/await to generators using babel-plugin-transform-async-to-generator. After that, create-react-app can polyfill generators by babel-plugin-transform-runtime, see config/babel.dev.js and config/babel.prod.js.

@gaearon
Copy link
Contributor

gaearon commented Aug 25, 2016

This probably means babel-plugin-syntax-async-functions is no longer needed?

@kripod
Copy link
Contributor Author

kripod commented Aug 25, 2016

@gaearon gaearon added this to the 0.3.0 milestone Aug 25, 2016
@gaearon
Copy link
Contributor

gaearon commented Aug 25, 2016

latest also contains transform-async-to-generator via 2017.
Do we still need the regenerator transform for async/await in this case?
What is the best way to enable both generators and async/await?

@ghost ghost added the CLA Signed label Aug 25, 2016
@kripod
Copy link
Contributor Author

kripod commented Aug 25, 2016

According to the documentation of babel-plugin-transform-regenerator, there are 3 regenerator transform options available: asyncGenerators, generators and async. I think that async should be set to false, but to be honest, I have no idea whether the value of asyncGenerators should be set to true or false. Maintainers of Babel may be able to help explaining the correct approach.

@kripod
Copy link
Contributor Author

kripod commented Aug 25, 2016

It looks like the term "async generator" may refer to an old proposal, so it could possibly be left untouched.

@gaearon gaearon modified the milestones: 0.2.3, 0.3.0 Aug 25, 2016
@gaearon gaearon merged commit 0182546 into facebook:master Aug 25, 2016
@gaearon
Copy link
Contributor

gaearon commented Aug 25, 2016

Thanks!

gaearon pushed a commit that referenced this pull request Aug 25, 2016
* Started using babel-preset-latest

* Updated babel dependencies

* Remove redundant babel-plugin-syntax-async-functions

* Disabled redundant regenerator transform
@gaearon gaearon mentioned this pull request Aug 25, 2016
stayradiated pushed a commit to stayradiated/create-react-app that referenced this pull request Sep 7, 2016
* Started using babel-preset-latest

* Updated babel dependencies

* Remove redundant babel-plugin-syntax-async-functions

* Disabled redundant regenerator transform
feiqitian pushed a commit to feiqitian/create-react-app that referenced this pull request Oct 25, 2016
* Started using babel-preset-latest

* Updated babel dependencies

* Remove redundant babel-plugin-syntax-async-functions

* Disabled redundant regenerator transform
@tabrezm
Copy link

tabrezm commented Dec 21, 2016

Sorry in advance for digging up an old PR, but there's a lot of context here about a particular change in .babelrc that caught my eye, specifically this. I was trying to understand the combination of transforms for async, and I came across this in babel-preset-es2015.

With the preset already setting async and asyncGenerators to false, do we really need to set it ourselves in babel-preset-react-app?

@gaearon
Copy link
Contributor

gaearon commented Dec 21, 2016

To be honest I don't remember. If this is still relevant can you file an issue?

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants