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

pipe operator: Add topicToken: ^ (caret) option #2575

Merged
merged 2 commits into from Oct 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 21 additions & 2 deletions docs/plugin-proposal-pipeline-operator.md
Expand Up @@ -22,7 +22,7 @@ Configure which proposal to use with the required `"proposal"` option.
| `"hack"` | [Hack-style pipes](https://github.com/js-choi/proposal-hack-pipes) | `v7.15.0`
| ~~`"smart"`~~ | [Smart-mix pipes](https://github.com/js-choi/proposal-smart-pipelines) (deprecated) | `v7.3.0`

If `"proposal": "hack"` is used, then a `"topicToken": "%"` or `"topicToken": "#"` option must also be included.
If `"proposal": "hack"` is used, then a `"topicToken": "%"`, `"topicToken": "^"`, or `"topicToken": "#"` option must also be included.

The `"proposal": "smart"` option is deprecated and subject to removal in a future major version.

Expand Down Expand Up @@ -284,7 +284,6 @@ For [F# pipes with `await`](https://github.com/valtech-nyc/proposal-fsharp-pipel
]
}
```

For [Hack pipes](https://github.com/js-choi/proposal-hack-pipes/) with `%` topic token:

```json
Expand All @@ -295,6 +294,16 @@ For [Hack pipes](https://github.com/js-choi/proposal-hack-pipes/) with `%` topic
}
```

For [Hack pipes](https://github.com/js-choi/proposal-hack-pipes/) with `^` topic token:

```json
{
"plugins": [
["@babel/plugin-proposal-pipeline-operator", { "proposal": "hack", "topicToken": "^" }]
]
}
```

For [Hack pipes](https://github.com/js-choi/proposal-hack-pipes/) with `#` topic token:

```json
Expand Down Expand Up @@ -341,6 +350,16 @@ require("@babel/core").transformSync("code", {
});
```

For [Hack pipes](https://github.com/js-choi/proposal-hack-pipes/) with `^` topic token:

```javascript
require("@babel/core").transformSync("code", {
plugins: [
[ "@babel/plugin-proposal-pipeline-operator", { proposal: "hack", topicToken: "^" } ],
],
});
```

For [Hack pipes](https://github.com/js-choi/proposal-hack-pipes/) with `#` topic token:

```javascript
Expand Down