Skip to content

Commit 4c472fb

Browse files
ntuckercursoragent
andauthored
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/2026-01-06-v0.15-vue-support-collection-remove.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ import Link from '@docusaurus/Link';
2727
- [ImmutableJS support moved to /imm exports](/blog/2026/01/06/v0.15-vue-support-collection-remove#immutablejs)
2828
- [Schema delegate interface consolidation](/blog/2026/01/06/v0.15-vue-support-collection-remove#schema-delegate)
2929

30+
Upgrade with an automated [codemod](/codemods/v0.15.js) for common breaking changes:
31+
32+
```bash
33+
npx jscodeshift -t https://dataclient.io/codemods/v0.15.js --extensions=ts,tsx,js,jsx src/
34+
```
35+
3036
<!-- truncate -->
3137

3238
import DiffEditor from '@site/src/components/DiffEditor';
@@ -286,6 +292,12 @@ This upgrade requires updating all package versions simultaneously.
286292

287293
<PkgTabs pkgs="@data-client/react@^0.15.0 @data-client/rest@^0.15.0 @data-client/test@^0.15.0 @data-client/img@^0.15.0" upgrade />
288294

295+
An automated [codemod](/codemods/v0.15.js) handles the breaking changes below:
296+
297+
```bash
298+
npx jscodeshift -t https://dataclient.io/codemods/v0.15.js --extensions=ts,tsx,js,jsx src/
299+
```
300+
289301
### useDebounce() returns [val, isPending] {#usedebounce}
290302

291303
[useDebounce()](/docs/api/useDebounce) now returns a tuple with pending state, matching patterns from React 19's `useTransition`. [#3459](https://github.com/reactive/data-client/pull/3459)

0 commit comments

Comments
 (0)