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

proposal-pipe: Add support for ^^ and @@ topics #13973

Merged
merged 4 commits into from Feb 2, 2022

Conversation

js-choi
Copy link
Contributor

@js-choi js-choi commented Nov 17, 2021

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

This pull request adds support for experimental ^^ and @@ topic tokens for the pipe operator.

I probably will make another pull request to deprecate all the other topicToken options after this gets merged, as per the recent November incubator meeting.

See also #13191, #13416, #13749. CC: @nicolo-ribaudo, @JLHwung, @tabatkins, @rbuckton, @mAAdhaTTah, @jridgewell, @sarahghp, @jamiebuilds.

@js-choi js-choi changed the title Double topics proposal-pipe: Add support for ^^ and @@ topics Nov 17, 2021
@JLHwung JLHwung added PR: New Feature 🚀 A type of pull request used for our changelog categories Spec: Pipeline Operator labels Nov 17, 2021
@nicolo-ribaudo nicolo-ribaudo added this to the v7.17.0 milestone Nov 19, 2021
js-choi added a commit to js-choi/babel that referenced this pull request Nov 19, 2021
This also allows expectPlugin and expectOnePlugin to give better error messages. For example:
> This experimental syntax requires enabling the parser plugin "pipelineOperator".
> This experimental syntax requires enabling the parser plugin ["pipelineOperator", {proposal: "hack", topicToken: "^^"}].

See babel#13973 (comment).
js-choi added a commit to js-choi/babel that referenced this pull request Nov 20, 2021
This also allows expectPlugin and expectOnePlugin to give better error messages. For example:
> This experimental syntax requires enabling the parser plugin "pipelineOperator".
> This experimental syntax requires enabling the parser plugin ["pipelineOperator", {proposal: "hack", topicToken: "^^"}].

See babel#13973 (comment).
js-choi added a commit to js-choi/babel that referenced this pull request Nov 26, 2021
This also allows expectPlugin and expectOnePlugin to give better error messages. For example:
> This experimental syntax requires enabling the parser plugin "pipelineOperator".
> This experimental syntax requires enabling the parser plugin ["pipelineOperator", {proposal: "hack", topicToken: "^^"}].

See babel#13973 (comment).
js-choi added a commit to js-choi/babel that referenced this pull request Nov 29, 2021
This also allows expectPlugin and expectOnePlugin to give better error messages. For example:
> This experimental syntax requires enabling the parser plugin "pipelineOperator".
> This experimental syntax requires enabling the parser plugin ["pipelineOperator", {proposal: "hack", topicToken: "^^"}].

See babel#13973 (comment).
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.

Could you rebase this on top #13827? These two PRs conflict (because they both modify @ tokenizing), and we plan to merge both in the next minor 🙏

packages/babel-parser/src/parser/expression.js Outdated Show resolved Hide resolved
@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Dec 5, 2021

Actually, don't rebase this on top of that branch yet because I want to first see what happens with tc39/proposal-decorators#437 at the next tc39 meeting.

@js-choi
Copy link
Contributor Author

js-choi commented Dec 16, 2021

@nicolo-ribaudo: The plenary approved the decorator changes away from init:. Are we good to rebase on #13827 now?

@nicolo-ribaudo
Copy link
Member

It's not needed anymore, since without @init: the decorators parsing is the same as in main.

@js-choi
Copy link
Contributor Author

js-choi commented Dec 17, 2021

I’m working on resolving #13973 (comment).

Do we need to add the new tokens to eslint/babel-eslint-parser/src/convert/convertTokens.cjs too?

nicolo-ribaudo
nicolo-ribaudo previously approved these changes Jan 8, 2022
@nicolo-ribaudo
Copy link
Member

Yes, we need to add them to this list:

@nicolo-ribaudo nicolo-ribaudo added the PR: Needs Review A pull request awaiting more approvals label Jan 26, 2022
Copy link
Member

@sosukesuzuki sosukesuzuki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment

packages/babel-parser/src/parser/expression.js Outdated Show resolved Hide resolved
Copy link
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good to me with some paring nits.

@nicolo-ribaudo nicolo-ribaudo force-pushed the double-topics branch 2 times, most recently from e52460a to 8101e2b Compare February 1, 2022 17:24
@nicolo-ribaudo nicolo-ribaudo added PR: Ready to be Merged A pull request with already two approvals, but waiting for the next minor release and removed PR: Needs Review A pull request awaiting more approvals labels Feb 1, 2022
@nicolo-ribaudo nicolo-ribaudo merged commit df27d54 into babel:main Feb 2, 2022
@js-choi
Copy link
Contributor Author

js-choi commented Feb 2, 2022

Thanks for the work, everyone. I will try to work on deprecating the other topic tokens (except for #), as well as @[] syntax for tuples, sometime in the next month.

@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 May 5, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 5, 2022
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 PR: Ready to be Merged A pull request with already two approvals, but waiting for the next minor release Spec: Pipeline Operator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants