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
Implement async-do-expressions transform #13117
Implement async-do-expressions transform #13117
Conversation
a916a70
to
b1319f1
Compare
Co-authored-by: Brian Ng <bng412@gmail.com>
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit e03a570:
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/45101/ |
ceee6d0
to
e03a570
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glad implementation seems pretty straightforward! I guess we aren't linking to the proposal repo other than on website?
Merging to @JLHwung Could you open a website PR adding a page for this plugin? |
Co-authored-by: Brian Ng <bng412@gmail.com>
Co-authored-by: Brian Ng <bng412@gmail.com>
Co-authored-by: Brian Ng <bng412@gmail.com>
The transform is derived from
babel/packages/babel-traverse/src/path/replacement.ts
Line 217 in 6d89daf
with changes listed below:
toSequenceExpression
call, an async arrow closure is always created@babel/parser
.yield
within the async do blockI avoided extending
NodePath#replaceExpressionWithStatements
because of the differences mentioned above and the hazard of breaking other plugins.Additional Context
When working on this PR, I realize that
babel/packages/babel-traverse/src/path/replacement.ts
Line 241 in 6d89daf
/cc @bakkot