-
Notifications
You must be signed in to change notification settings - Fork 26
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
async/await #105
Comments
I found the issue. .pipe(plugins['6to5'], { experimental: true }) instead of this: .pipe(plugins['6to5'], build.config['6to5']) and it works. Probably the blacklisted |
Weird. I'm pretty sure co-prompt was throwing errors when we transpiled generators. It looks like the async functions transform converts them to generators, so the async functions transform doesn't work/is ignored when we blacklist generators. I believe this makes sense, anyway, @sebmck can you confirm? @jaydson change the '6to5': { experimental: true }, Does this work? |
If that's the issue, then we can replace co-prompt with Inquirer (#68) then remove generators from the blacklist and use async functions. 😄 |
Async functions and generators are transformed in the same transformer (it's delegated to regenerator). It's confusing I know but since 3.0.0 is going to include a regenerator fork it'll allow it to be split up into multiple transformers. |
@sebmck oh nice! Thanks for the clarification. 😄 |
@UltCombo both |
Oh, now i got it. |
Oh nice. Btw, the whole idea behind the Of course, in the future Harmonic may need a more complex gulpfile than slush-es6's, but for the time being this workflow has been working nicely. 😃 |
@jaydson also, please test IIRC, co-prompt was throwing an error when we passed a transpiled generator to it. As we've discussed earlier, we can't transpile generators with regenerator as |
There's probably regenerator'ed versions of |
I think we can replace Weird thing is i've tested |
@jaydson perhaps it was an issue with one of our dependencies that got fixed. Never mind it if it is working as expected for you.
👍 |
We're already using |
I'm trying to use async/await(es7) (experimental feature in 6to5) but i'm not sure gulp-6to5 is working.
I've changed
build.js
file:My sample code:
And i get the following error:
events.js:85 throw er; // Unhandled 'error' event ^ /home/jaydson/Workspace/harmonic/dist/bin/parser.js:19 async function test() { ^^^^^^^^ SyntaxError: Unexpected token function
The async function is not being transpiled.
Any thoughts @UltCombo ?
The text was updated successfully, but these errors were encountered: