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

Add support for the "Hack" pipeline proposal #13191

Merged

Conversation

js-choi
Copy link
Contributor

@js-choi js-choi commented Apr 22, 2021

Q                       A
Fixed Issues? None
Patch: Bug Fix? No
Major: Breaking Change? No
Minor: New Feature? Yes
Tests Added + Pass? Yes
Documentation PR Link babel/website#2541
Any Dependency Changes? No
License MIT

@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.

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.
@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 22, 2021

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:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@nicolo-ribaudo nicolo-ribaudo self-requested a review April 22, 2021 07:55
@nicolo-ribaudo nicolo-ribaudo added the PR: New Feature 🚀 A type of pull request used for our changelog categories label Apr 22, 2021
@js-choi js-choi changed the title Proposal hack pipes Proposal: Hack pipes Apr 22, 2021
@mAAdhaTTah
Copy link
Contributor

Rename "smart" pipe-proposal option to "hack"

This is going to break backwards compatibility so I don't think we can do this.

@JLHwung JLHwung self-requested a review April 22, 2021 15:35
@JLHwung
Copy link
Contributor

JLHwung commented Apr 22, 2021

Rename "smart" pipe-proposal option to "hack"

This is going to break backwards compatibility so I don't think we can do this.

It has been reverted in 11a7a49.

@JLHwung
Copy link
Contributor

JLHwung commented Apr 22, 2021

@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

@nicolo-ribaudo nicolo-ribaudo added this to the v7.15.0 milestone May 1, 2021
@js-choi
Copy link
Contributor Author

js-choi commented May 30, 2021

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.

@js-choi
Copy link
Contributor Author

js-choi commented May 30, 2021

Need to add a check for the conflict between pipelineOperator: { topicToken: "#" } and recordAndtuple: { syntaxType: "hash"} due to #[]. See tc39/proposal-hack-pipes#2 (comment).

Edit: This is done in 7cdf3ac and 640d974.

@nicolo-ribaudo
Copy link
Member

I’m not sure why the create-react-app CI check is failing; I am unable to reproduce it.

e2e tests are sometimes flaky; that specific failure seems completely unrelated to this PR.

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a 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 👍

@nicolo-ribaudo
Copy link
Member

Do you want me to squash-merge this into a feat-7.15.0/hack-pipes branch so that you can open a PR for % on top of that?

@js-choi
Copy link
Contributor Author

js-choi commented Jun 2, 2021

@nicolo-ribaudo That plan sounds good. 👍

@nicolo-ribaudo nicolo-ribaudo changed the base branch from main to feat-7.15.0/hack-pipes June 2, 2021 21:53
@nicolo-ribaudo nicolo-ribaudo changed the title Proposal: Hack pipes Add support for the "Hack" pipeline proposal Jun 2, 2021
@nicolo-ribaudo nicolo-ribaudo merged commit b5adde3 into babel:feat-7.15.0/hack-pipes Jun 2, 2021
Pipeline Operator automation moved this from In progress to Done Jun 2, 2021
@nicolo-ribaudo
Copy link
Member

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.

js-choi added a commit to js-choi/babel that referenced this pull request Jun 5, 2021
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.
@js-choi js-choi deleted the proposal-hack-pipes branch June 7, 2021 16:00
nicolo-ribaudo added a commit that referenced this pull request Jun 8, 2021
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
nicolo-ribaudo added a commit that referenced this pull request Jul 6, 2021
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
nicolo-ribaudo added a commit that referenced this pull request Jul 6, 2021
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
nicolo-ribaudo added a commit that referenced this pull request Aug 3, 2021
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
nicolo-ribaudo added a commit that referenced this pull request Aug 3, 2021
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Sep 7, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: New Feature 🚀 A type of pull request used for our changelog categories Spec: Pipeline Operator
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants