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
Transform for F# Pipeline #9984
Transform for F# Pipeline #9984
Conversation
Inludes support for optimizing single-parameter arrow functions
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/10799/ |
@@ -1,3 +1,5 @@ | |||
var _ref, _a; |
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.
It seems that these aren't needed 🤔
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.
Nope... I'm almost sure that they're an artifact of declaring the placeholder in the visitor and then throwing it away during optimization.
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.
Found a quick solution in 29fa385. Let me know what you think.
// (a = b, ((c) => d + e)(a)) | ||
// to | ||
// (a = b, a + e) | ||
const buildOptimizedSequenceExpression = ({ assign, call, path }) => { |
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.
(Note for reviewers: this function isn't new; it has been moved here from https://github.com/babel/babel/blob/b5febcf1f993cc3ec36fda7c7908181048a0069f/packages/babel-plugin-proposal-pipeline-operator/src/minimalVisitor.js)
🎉 |
* Transform for F#-style await Inludes support for optimizing single-parameter arrow functions * Wait until optimization before pushing placeholder into scope
🎉 |
* Transform for F#-style await Inludes support for optimizing single-parameter arrow functions * Wait until optimization before pushing placeholder into scope
This adds the transform for the
fsharp
pipeline proposal.It is a port to the main babel repo of the work that happened in mAAdhaTTah#1
cc @nicolo-ribaudo @mAAdhaTTah