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
Add support for the "Hack" pipeline proposal #13191
Add support for the "Hack" pipeline proposal #13191
Conversation
In preparation for upcoming renaming commit. Titles are now already arguably more readable.
Unwrap and remove the PipelineBody, PipelineBareFunctionBody, PipelineBareConstructorBody, PipelineBareAwaitedFunctionBody, PipelineTopicBody, and PipelineStyle types.
The “primary” part was a vestige of the old smart-mix pipeline proposal.
For backwards compatibility until next major change. To maintain simplicity in the code before smart mix is removed, smart mix was modified to match the new Hack-pipe proposal: • No early errors for sequences in pipe heads or bodies. • Function declarations and if/catch/for/with statements do not hide outer topics.
In anticipation of test fixtures for other topic tokens.
Failure was due to lack of support for async functions.
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 640d974:
|
This is going to break backwards compatibility so I don't think we can do this. |
It has been reverted in 11a7a49. |
@js-choi You can skip the async function execution tests on Node.js 6 like we did in https://github.com/babel/babel/blob/672a58660f0b15691c44582f1f3fdcdac0fa0d2f/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/yield/options.json |
packages/babel-plugin-proposal-pipeline-operator/src/hackVisitor.js
Outdated
Show resolved
Hide resolved
I noted some further missing smart-mix test fixtures, which I added back. I manually reviewed everything, and as far as I can tell, there should be nothing else missing. I also changed the unbound-topic error and comma-head error to match the old behavior of the smart-mix mode. Every issue raised so far should be now fully addressed, as far as I can tell. I’m not sure why the create-react-app CI check is failing; I am unable to reproduce it. |
Need to add a check for the conflict between |
e2e tests are sometimes flaky; that specific failure seems completely unrelated to this PR. |
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.
I left one last comment, but otherwise this PR looks good 👍
Do you want me to squash-merge this into a |
@nicolo-ribaudo That plan sounds good. 👍 |
Merged in https://github.com/babel/babel/tree/feat-7.15.0/hack-pipes! I you'll need that branch to be rebased let me know. |
Fix errors for invalid topic references so that the errors point to the topic tokens themselves, rather than immediately after them. Reverts a breaking change to smart-mix pipe error positions made in babel#13191.
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
@xixixao and I discussed it a bit more over email, and since he’s dealing with another open-source project, he won’t be able to work on #11600 much for the foreseeable future. So I’ll just open a pull request of my own for the Hack-pipes proposal under consideration by TC39. CC @tabatkins, @ljharb, @mAAdhaTTah.