Commit 4c472fb
docs: Add v0.15 migration codemod (reactive#3852)
* docs: Add v0.15 migration codemod
jscodeshift codemod automating common v0.15 breaking changes:
- useDebounce() plain value → [value] array destructuring
- state.entityMeta → state.entitiesMeta
- MemoCache.buildQueryKey/.query state arg consolidation
- INVALID import → delegate.INVALID / delegate.invalidate()
Includes tests and blog post references linking the codemod.
Made-with: Cursor
* test(codemod): fix no-op expected output in v0.15 tests
Co-authored-by: Nathaniel Tucker <me@ntucker.me>
* Fix useDebounce codemod typed annotation handling
Co-authored-by: Nathaniel Tucker <me@ntucker.me>
* Fix entityMeta codemod computed-member matching
Co-authored-by: Nathaniel Tucker <me@ntucker.me>
* Fix v0.15 codemod export specifier INVALID handling
Co-authored-by: Nathaniel Tucker <me@ntucker.me>
* Fix transformInvalid dirty flag no-op rewrites
Co-authored-by: Nathaniel Tucker <me@ntucker.me>
* Fix entityMeta codemod for identifier object keys
Co-authored-by: Nathaniel Tucker <me@ntucker.me>
* Fix transformEntityMeta to handle identifier-keyed properties
The StringLiteral handler at lines 81-94 renames string-literal property
keys ({ 'entityMeta': value }) but no equivalent handler existed for the
far more common identifier property keys in object literals or patterns.
Add an Identifier handler that covers:
- Identifier keys: { entityMeta: value } → { entitiesMeta: value }
- Shorthand properties: { entityMeta } → { entitiesMeta: entityMeta }
- Destructuring patterns: const { entityMeta } = state → const { entitiesMeta: entityMeta } = state
- Non-shorthand destructuring: const { entityMeta: meta } = state → const { entitiesMeta: meta } = state
- Computed keys are correctly skipped: { [entityMeta]: value } unchanged
Co-authored-by: Nathaniel Tucker <me@ntucker.me>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>1 parent 80a6e18 commit 4c472fb
3 files changed
Lines changed: 819 additions & 0 deletions
File tree
- website
- blog
- static/codemods
- __tests__
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
| |||
286 | 292 | | |
287 | 293 | | |
288 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
289 | 301 | | |
290 | 302 | | |
291 | 303 | | |
| |||
0 commit comments