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

Proper eventual-send (wavy-dot, aka tildot) support #11348

Open
1 task done
michaelfig opened this issue Mar 28, 2020 · 1 comment
Open
1 task done

Proper eventual-send (wavy-dot, aka tildot) support #11348

michaelfig opened this issue Mar 28, 2020 · 1 comment

Comments

@michaelfig
Copy link

michaelfig commented Mar 28, 2020

Feature Request

  • I would like to work on this feature!

Is your feature request related to a problem? Please describe.
The only problem is wanting to land the new "wavy-dot" eventual send syntax (currently stage1) in Babel.

Describe the solution you'd like
Add and implement an ["eventualSend"] parser option.

babel-plugin-syntax-eventual-send and babel-plugin-proposal-eventual-send would be the next steps.

Describe alternatives you've considered
I had a quick hack to get this working (without a clean factoring) in #10115. This current proposal is to implement it the right way according to Babel conventions.

Teachability, Documentation, Adoption, Migration Strategy

Enabling babel-plugin-syntax-eventual-send will enable the "eventualSend" parser plugin. That will emit new nodes in alignment with the proposed syntax:

// foo~.bar
{ type: "EventualMemberExpression", eventual: true, object: foo, property: bar, computed: false }
// foo~.[i]
{ type: "EventualMemberExpression", eventual: true, object: foo, property: i, computed: true }
// foo~.(...args)
{ type: "EventualCallExpression", eventual: true, callee: foo, arguments: args }

Secondly, a new babel-plugin-proposal-eventual-send will actually implement EventualCallExpression|EventualMemberExpression in terms of HandledPromise static methods, including the needed pipelining semantics of optimising a member followed by call as a "method", and rewriting ExpressionStatement expressions whose value is discarded as "send-only" methods.

Shout out to: @erights, @FUDCo, @kriskowal.
I'd appreciate feedback from: @loganfsmyth, @jridgewell

@babel-bot
Copy link
Collaborator

Hey @michaelfig! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants