-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Don't use regenerator
in babel-preset-es2015
for newer Node.js versions
#348
Comments
What do you think about using a post install script ? |
@thedev This isn't about having |
The Babel preset would not accept a pull request for that, just because the environment that is running Babel supports generators does not mean the targeted environment will. If you want to create a preset |
@thejameskyle That's a good point. I just considered our case of live transpiling. Would you be open to add an option to the preset for toggling |
@sindresorhus: Check out hax/babel-features. I'll turn it into a preset if you want. Or we could just use it directly. |
@sindresorhus: Actually, I went ahead and turned that into a preset anyway: |
I ran into the same issue, went with https://github.com/alekseykulikov/babel-preset-es2015-node5 for now |
@tmaximini What issue? The only difference should be one of performance. If you've got other issues let us know. |
Closing in favor of #148. |
@jamestalmage performance always matters, and it's always good to have as much as possible a generated code side-by-side with the source one. If we have native support, we should always use it, there is absolutely no reason to use something ugly and gross on top of something that already exists and performs well. I can understand people using bluebird instead of the native Promise, for example, but using a feature like regenerator, only if targeting browsers. Another great difference: Debugging is terrible with regenerators, and it's awesome with native generators. |
Split out of #333.
Only Node.js 0.10 needs
regenerator
, but it's currently included for any Node.js version.Someone needs to do a pull request to
babel-preset-es2015
and auto-detect generator support and conditionally includeregenerator
(preferred solution) or add an option for togglingregenerator
.// @thejameskyle @jamestalmage
The text was updated successfully, but these errors were encountered: