|
1 | 1 | 'use strict' |
2 | 2 |
|
3 | | -// The rewriter works effectively the same as Orchestrion with some additions: |
4 | | -// - Supports an `astQuery` field to filter AST nodes with an esquery query. |
5 | | -// - Supports replacing methods of child class instance in the base constructor. |
| 3 | +/* |
| 4 | +This rewriter is basically a JavaScript version of Orchestrion. The goal is not |
| 5 | +to replace Orchestrion, but rather to make it easier and faster to write new |
| 6 | +integrations in the short-term, especially as many changes to the rewriter will |
| 7 | +be needed as all the patterns we need have not been identified yet. This will |
| 8 | +avoid the back and forth of having to make Rust changes to an external library |
| 9 | +for basically every integration change or addition. |
| 10 | +
|
| 11 | +The long term goal is to backport any additional feature we add to the JS |
| 12 | +rewriter to Orchestrion once we're confident that the implementation is fairly |
| 13 | +complete and has all features we need. This should ideally happen by summer |
| 14 | +2026, but it will depend on how quickly we start using the rewriter more. |
| 15 | +
|
| 16 | +Here is a list of the additions and changes in this rewriter compared to |
| 17 | +Orchestrion that will need to be backported: |
| 18 | +
|
| 19 | +(NOTE: Please keep this list up-to-date whenever new features are added) |
| 20 | +
|
| 21 | +- Supports an `astQuery` field to filter AST nodes with an esquery query. This |
| 22 | + is mostly meant to be used when experimenting or if what needs to be queried |
| 23 | + is not a function. We'll see over time if something like this is needed to be |
| 24 | + backported or if it can be replaced by simpler queries. |
| 25 | +- Supports replacing methods of child class instances in the base constructor. |
| 26 | +*/ |
6 | 27 |
|
7 | 28 | const { readFileSync } = require('fs') |
8 | 29 | const { join } = require('path') |
|
0 commit comments