v2.0.0-beta.1
Pre-release
Pre-release
jedwards1211
released this
14 Aug 04:34
·
221 commits
to beta
since this release
2.0.0-beta.1 (2021-08-14)
Bug Fixes
- babel-generator: use concise mode (3c60692)
- babel-generator issues (0065da9)
- bug with replacing an ExpressionStatement with multiple Statements (536e8db)
- capture escape bugs (bebd341)
- implement convertReplacement system (72b155c)
- issue in GenericNodeMatcher/GenericNodeReplacement (ab46d74)
- remove Collection from Astx API (bc00c2e)
- replace lodash.cloneDeep (8fcdf7d)
- string capture escaping (420a5e0)
- Astx: support passing ASTNode to replace (33289ee)
- Capture: allow (JSX)Identifier captues/backreferences to match (6beb33a)
- Capture: allow identifier backreference to match shorthand property (b918816)
- compileMatcher: improve JSX children matching (645e55d)
- compileMatcher: use ASTPaths instead of ASTNodes (8c390f8)
- parseFindOrReplace: default to function and class declarations instead of expressions (65320b1)
- replace: fix regression (f89611d)
- replace: support replacing with non-expression nodes (e66a40c)
- more WIP on compileReplacement (ddd43ba)
- support $id: $typeAnnotation capture and replace (59ffe86)
- use $$ instead of $_ for array capture (5363913)
- various issues, add renderPropsStylesRefactor test case (0b67737)
- transform: work around ridiculous recast behavior (e804b44)
Features
- add --babel-generator option (4df4cbe)
- implement /**/ extraction in patterns (8c1a7e6)
- Astx: add .closest, make API more like jscodeshift (54d6110)
- Astx: add .withCaptures() method (e1f270a)
- Astx: add captures() and arrayCaptures() methods (e5c0dc3)
- Astx: add size(), length, matches(), match(), paths(), nodes(), filter() (35f98ce)
- find: add <...> type annotation matching (ec88368)
- find: add withCaptures option (94e58cb)
- find: implement (...) and fix variable declarator matching (21fb1cf)
- find: implement (...), (...), <...>, and <...> (7b67082)
- transform: format reported Astx collections (109b217)
- allow transform fn to return false (a12bd7c)
- more refactoring and fixes (ccc602f)
- WIP on compile-replacement (6808561)
BREAKING CHANGES
- you must now begin array capture variables with
$$
instead of$_
, and use leading$_
as an escape for$
instead of$$
. This is to mimic how jQuery$
/$$
select single/multiple elements respectively. Hopefully it should be easier for everyone to understand for array capture - removed
replaceMatches
andReplaceOptions
exports Astx
: import paths have been moved toastx/jscodeshift
(there will also beastx/babel
in the future)Astx
: use.find`...`().replace`...`()
instead of.find`...`.replace`...`
Astx
: use.replace`...`()
instead of.replace`...`
Astx
: no longer has aroot
property, and the constructor no longer accepts a jscodeshift Collection instance.Astx
:.findStatements
and.findAuto
have been removed, now you can use `.find for statements or a single node pattern.compileMatcher
:Match
andStatementsMatch
have been merged into a single type.