babel / babel/proposals

Pipeline Operator (Stage 1)

Open
#29 26 comments 121 reactions 1 assignee Claimed by @littledan View on GitHub
Proposal Issue Transform: Done
Dominant language
No language data
Stars
435
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Champion: @littledan
Spec Repo: https://github.com/tc39/proposal-pipeline-operator
First presented at Sept 2017 meeting: https://github.com/tc39/agendas/blob/master/2017/09.md
Slides: https://docs.google.com/presentation/d/1qiWFzi5dkjuUVGcFXwypuQbEbZk-BV7unX0bYurcQsA/edit#slide=id.p
Related proposal: Partial Application https://github.com/rbuckton/proposal-partial-application by @rbuckton
Related proposal: Function Bind Operator https://github.com/tc39/proposal-bind-operator

## Basic Example

### Input

```js
let result = "hello"
|> doubleSay
|> capitalize
|> exclaim;
result //=> "Hello, hello!"
```

### Output
```js
let result = exclaim(capitalize(doubleSay("hello")));
result //=> "Hello, hello!"
```

## Initial Implementation (would need updating to v7)

- Initial Spec PR by @littledan https://github.com/tc39/proposal-pipeline-operator/pull/51

## Old/Alternative Implementations

- Old PR to Babel: https://github.com/babel/babel/pull/3159
- https://github.com/SuperPaintman/babel-plugin-transform-pipeline
- `<<` and `>>`: https://github.com/michaelmitchell/babel-plugin-pipe-composition

cc @gilbert, @SuperPaintman

## Implementation

- [x] Parser PR: https://github.com/babel/babylon/pull/742
- [x] Transform PR: https://github.com/babel/babel/pull/6335
- Feedback around relating Pipeline Operator, Function Bind, Partial Application

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.