Skip to content

Commit 7732879

Browse files
committed
add changeset
1 parent 2156b05 commit 7732879

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.changeset/huge-rules-yell.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
"zmod": minor
3+
---
4+
5+
adds a jscodeshift-compatible `z()` API that runs ~8x faster than jscodeshift, with no jscodeshift dependency.
6+
7+
- Collection API: find, replaceWith, remove, insertBefore,insertAfter, forEach, filter, closest
8+
- NodePath with parent, parentKey, scope traversal
9+
- `run(transform, { include })` for batch file execution
10+
- 21 react-codemod fixtures passing as integration tests
11+
12+
| Scenario | zmod (ms) | jscodeshift (ms) | Speedup |
13+
| ---------------------------- | --------- | ---------------- | ------- |
14+
| parse + toSource (small) | 0.02 | 0.19 | 10.8x |
15+
| parse + toSource (medium) | 0.12 | 0.98 | 7.9x |
16+
| parse + toSource (large) | 2.51 | 17.34 | 6.9x |
17+
| find CallExpression (medium) | 0.11 | 0.6 | 5.2x |
18+
| find + filter (medium) | 0.11 | 0.55 | 5.1x |
19+
| find + replaceWith (medium) | 0.11 | 1.14 | 10x |
20+
| find + remove (medium) | 0.11 | 1.06 | 9.5x |
21+
| findJSXElements (medium) | 0.11 | 0.52 | 4.7x |
22+
| complex transform (large) | 2.55 | 30.31 | 11.9x |
23+
24+
Average speedup: **7.9x**

0 commit comments

Comments
 (0)