data-client-v0.18-migration

Migrates @data-client codebases to v0.18 delegate signatures using a codemod and manual fixes.

2.0k|99|Updated Feb 15, 2019
One-click install
npx skills add https://github.com/reactive/data-client --skill data-client-v0-18-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-client-v0.18-migration
Source: https://github.com/reactive/data-client/tree/main/.agents/skills/data-client-v0.18-migration
Command: npx skills add https://github.com/reactive/data-client --skill data-client-v0-18-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Upgrading @data-client to v0.18 breaks custom Schema implementations because denormalize and normalize now take a single delegate object instead of separate args, unvisit, and visit parameters. This Skill runs the official codemod and guides you through the cases it cannot automate, including registering argsKey for schemas whose output depends on endpoint args.

Core Features & Use Cases

  • Pre-check scan: Uses ripgrep or grep to detect whether your codebase actually contains custom Schema subclasses before running any migration.
  • Automated codemod execution: Runs the jscodeshift-based v0.18 codemod against the correct source roots while avoiding node_modules and unsupported SFC files.
  • Manual migration guidance: Covers class fields, computed keys, helper functions, and interface signatures the codemod skips, plus argsKey registration for cache-correct invalidation.
  • Use Case: A team upgrading a React app with custom polymorphic schemas runs the pre-check, applies the codemod to src/, then hand-migrates two class-field denormalize definitions and registers argsKey on a lens-based schema.

Quick Start

Ask the assistant to migrate my @data-client schemas to the v0.18 delegate signature and verify nothing was missed.

Frequently Asked Questions about data-client-v0.18-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate @data-client schemas to v0.18?

Run the official jscodeshift codemod from dataclient.io against your source roots, then hand-migrate the cases it skips such as class fields and computed keys. Finally register argsKey on any schema whose output depends on endpoint args.

Do I need to change anything for @data-client v0.18 if I only use built-in schemas?

No. Apps that only consume built-in schemas like Entity, resource(), Collection, and Query need zero code changes. Run the ripgrep pre-check to confirm no custom Schema subclasses exist, then just bump the package versions.

Why does my denormalize cache not invalidate after upgrading to v0.18?

Reading delegate.args no longer participates in memoization in v0.18. Schemas whose output varies with endpoint args must register that dependency via delegate.argsKey(fn) with a referentially stable function.

Does the v0.18 codemod work on Vue or Svelte single-file components?

No. The codemod uses jscodeshift's tsx parser, which cannot parse SFC files. Extract schemas from <script> blocks into plain .ts files first, or migrate those files by hand using the documented rewrite shape.

What cases does the v0.18 codemod skip?

It skips files without @data-client imports, class field arrow functions, const function expressions, computed or dynamic method keys, certain interface method signatures, and custom helper functions wrapping args and unvisit.