Commit a35af3e
authored
[hack pipes] Inline topic token when possible (#14278)
* Optimize away `|> #` pipes
* Inline topic token when it's used once and there are no side effects
* Fix deferred topic evaluation
* Update standalone tests1 parent 1937284 commit a35af3e
158 files changed
Lines changed: 459 additions & 386 deletions
File tree
- packages
- babel-plugin-proposal-pipeline-operator
- src
- test/fixtures
- hack-caret
- hash-tuple
- pipe-body-identity
- pipe-body-with-addition
- pipe-body-with-arrow-function-and-nested-pipe
- pipe-body-with-arrow-function
- pipe-body-with-await
- pipe-body-with-class-expression-and-private-properties
- pipe-body-with-eval
- pipe-body-with-nested-pipe
- pipe-body-with-object-literal
- pipe-body-with-topic-method-call
- pipe-body-with-yield
- pipe-head-with-nested-pipe
- pipe-in-arrow-function
- topic-token-in-function
- transform-arrow-functions
- transform-await-and-arrow-functions
- while-statement-with-pipe-in-condition
- within-assignment
- within-for-classic-statement-init
- within-for-classic-statement-test
- within-for-classic-statement-update
- within-generator-with-yield
- hack-double-at
- class-decorator
- hash-tuple
- pipe-body-identity
- pipe-body-with-addition
- pipe-body-with-arrow-function-and-nested-pipe
- pipe-body-with-arrow-function
- pipe-body-with-await
- pipe-body-with-class-expression-and-private-properties
- pipe-body-with-eval
- pipe-body-with-nested-pipe
- pipe-body-with-object-literal
- pipe-body-with-topic-method-call
- pipe-body-with-yield
- pipe-head-with-nested-pipe
- pipe-in-arrow-function
- topic-token-in-function
- transform-arrow-functions
- transform-await-and-arrow-functions
- while-statement-with-pipe-in-condition
- within-assignment
- within-for-classic-statement-init
- within-for-classic-statement-test
- within-for-classic-statement-update
- within-generator-with-yield
- hack-double-caret
- class-decorator
- hash-tuple
- pipe-body-identity
- pipe-body-with-addition
- pipe-body-with-arrow-function-and-nested-pipe
- pipe-body-with-arrow-function
- pipe-body-with-await
- pipe-body-with-class-expression-and-private-properties
- pipe-body-with-eval
- pipe-body-with-nested-pipe
- pipe-body-with-object-literal
- pipe-body-with-topic-method-call
- pipe-body-with-yield
- pipe-head-with-nested-pipe
- pipe-in-arrow-function
- topic-token-in-function
- transform-arrow-functions
- transform-await-and-arrow-functions
- while-statement-with-pipe-in-condition
- within-assignment
- within-for-classic-statement-init
- within-for-classic-statement-test
- within-for-classic-statement-update
- within-generator-with-yield
- hack-hash
- pipe-body-identity
- pipe-body-with-addition
- pipe-body-with-arrow-function-and-nested-pipe
- pipe-body-with-arrow-function
- pipe-body-with-await
- pipe-body-with-class-expression-and-private-properties
- pipe-body-with-eval
- pipe-body-with-nested-pipe
- pipe-body-with-object-literal
- pipe-body-with-topic-method-call
- pipe-body-with-yield
- pipe-head-with-nested-pipe
- pipe-in-arrow-function
- topic-token-in-function
- transform-arrow-functions
- transform-await-and-arrow-functions
- while-statement-with-pipe-in-condition
- within-assignment
- within-for-classic-statement-init
- within-for-classic-statement-test
- within-for-classic-statement-update
- within-generator-with-yield
- hack-percent
- hash-tuple
- pipe-body-identity
- pipe-body-with-addition
- pipe-body-with-arrow-function-and-nested-pipe
- pipe-body-with-arrow-function
- pipe-body-with-await
- pipe-body-with-class-expression-and-private-properties
- pipe-body-with-eval
- pipe-body-with-nested-pipe
- pipe-body-with-object-literal
- pipe-body-with-topic-method-call
- pipe-body-with-yield
- pipe-head-with-nested-pipe
- pipe-in-arrow-function
- topic-token-in-function
- transform-arrow-functions
- transform-await-and-arrow-functions
- while-statement-with-pipe-in-condition
- within-assignment
- within-for-classic-statement-init
- within-for-classic-statement-test
- within-for-classic-statement-update
- within-generator-with-yield
- babel-standalone/test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 52 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
6 | 25 | | |
7 | 26 | | |
8 | 27 | | |
| |||
22 | 41 | | |
23 | 42 | | |
24 | 43 | | |
25 | | - | |
26 | 44 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | 45 | | |
31 | 46 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
39 | 69 | | |
40 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
41 | 79 | | |
42 | 80 | | |
43 | 81 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | | - | |
| 2 | + | |
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
4 | 2 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
4 | 2 | | |
5 | 3 | | |
6 | 4 | | |
7 | | - | |
| 5 | + | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
| |||
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
18 | | - | |
| 16 | + | |
19 | 17 | | |
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | | - | |
| 2 | + | |
5 | 3 | | |
0 commit comments