Data Client V0.18 Migration logo

Data Client V0.18 Migration

OrganizationPopular
reactive
data-client-v0.18-migration

Migrate @data-client codebases to v0.18 delegate signatures. Drives the v0.18 codemod and then handles the cases it cannot — especially registering argsKey for schemas whose output depends on endpoint args. Use when upgrading to v0.18, seeing TS errors about unvisit/visit/args/delegate signatures, or adapting custom Schema implementations.

Overview

Publisherreactive
Repositorydata-client
Skill namedata-client-v0.18-migration
Stars
2K
Forks
98
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by reactive on GitHub. Read the source before you install it.

Installation

Install the Data Client V0.18 Migration AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/reactive/data-client/tree/master/.agents/skills/data-client-v0.18-migration
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/reactive/data-client.git /tmp/data-client
mkdir -p .claude/skills
cp -r /tmp/data-client/.agents/skills/data-client-v0.18-migration .claude/skills/data-client-v0.18-migration
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Data Client V0.18 Migration in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Data Client V0.18 Migration on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Data Client V0.18 Migration is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

@data-client v0.18 Migration

Applies to anyone implementing a custom Schema — SchemaSimple, SchemaClass, polymorphic wrappers, or types that subclass EntityMixin directly. Built-in schemas (Entity, resource(), Collection, Union, Values, Array, Object, Query, Invalidate, Lazy) are migrated by the library.

What changed

Schema.denormalize and Schema.normalize now take a single delegate instead of (args, unvisit) / (args, visit, delegate):

ts
denormalize(input, delegate) { return delegate.unvisit(this.schema, input); }
normalize(input, parent, key, delegate /*, parentEntity? */) {
  return delegate.visit(this.schema, input, parent, key);
}

Critical semantic change: reading delegate.args does not contribute to cache invalidation. Schemas whose output varies with endpoint args must register that dependency through delegate.argsKey(fn). See Step 2 below.

Step 1: run the codemod

Pre-check — skip the rest of this skill if it doesn't apply. Most apps that only consume @data-client (use Entity, resource(), Collection, Query, etc.) need zero code changes for v0.18. Run the search below at your repo root — rg respects .gitignore so it won't dive into node_modules. If it returns nothing, you're done; bump the package versions and move on.

bash
# preferred (ripgrep)
rg -n 'extends (Schema|SchemaSimple|SchemaClass|EntityMixin)\b|^\s*_?(de)?normalize\s*[(=:]|\bunvisit\b|\bvisit\(' .
# fallback (POSIX grep) — adjust the path list to your source roots
grep -rEn --include='*.ts' --include='*.tsx' --include='*.js' --include='*.jsx' \
  'extends (Schema|SchemaSimple|SchemaClass|EntityMixin)\b|^[[:space:]]*_?(de)?normalize[[:space:]]*[(=:]|\bunvisit\b|\bvisit\(' \
  src app lib packages 2>/dev/null

The pre-check intentionally ignores Entity overrides of pk, process, and merge — those signatures didn't change in v0.18. Only the denormalize / normalize delegate signature did.

Otherwise, commit first so you can diff, then run the codemod against your source roots — src/ is the conventional location, but App Router (app/), Vue (src/), monorepo packages (packages/), and library (lib/) layouts all need the path adjusted:

bash
npx jscodeshift -t https://dataclient.io/codemods/v0.18.js --extensions=ts,tsx,js,jsx <source-root>

Do not point jscodeshift at the repo root — it doesn't respect .gitignore and will walk into node_modules.

A clean run looks like 0 errors, N unmodified, 0 skipped — that's expected, not a failure. The codemod rewrites parameter lists, body references (unvisit(…), visit(…), bare args), pass-through calls, TS method/property signatures, and adds IDenormalizeDelegate / INormalizeDelegate imports. After it runs, only the cases below need hand work.

Single-file components (Vue/Svelte/Astro/MDX): the codemod uses jscodeshift's tsx parser, which can't parse SFCs — adding .vue (etc.) to --extensions produces parse errors, not transforms. If your schemas live inside SFC <script> blocks, either extract them to plain .ts first (preferred — schemas are usually shared across components anyway) or migrate those files by hand using the rewrite shape from Step 3.

Step 2: register argsKey for args-dependent schemas (not automatable)

If your schema's return value depends on endpoint args, the codemod will rewrite args → delegate.args, but that read alone no longer participates in memoization. Register the dependency explicitly so the cache invalidates correctly.

argsKey(fn) returns fn(args) and uses the function reference itself as the cache path key. fn must be referentially stable — bind it on the instance or at module scope. An inline arrow creates a new reference per call and misses the cache every time.

ts
class LensSchema {
  constructor({ lens }) {
    this.lensSelector = lens;
  }
  denormalize(input, delegate) {
    const lens = delegate.argsKey(this.lensSelector);
    return this.lookup(input, lens);
  }
}

See Scalar for a real-world example.

Step 3: hand-migrate cases the codemod skips

The codemod no-ops on these — find them and update by hand. The shape of the change is always the same: (input, args, unvisit) → (input, delegate) and (input, parent, key, args, visit, delegate[, parentEntity]) → (input, parent, key, delegate[, parentEntity]), with unvisit/visit becoming delegate.unvisit/delegate.visit and bare args becoming delegate.args.

  • Files with no @data-client/* import — the codemod gates on this. Either add an import or migrate the file by hand.
  • Class fields — denormalize = (input, args, unvisit) => { ... }. Rewrite to a method (denormalize(input, delegate) { ... }) so future codemods catch it too.
  • const denormalize = function... / const normalize = function... — only function declarations and methods are matched.
  • Computed or dynamic method keys — [name]: function(...), obj.denormalize = function(...). Identifier and string-literal keys are matched; nothing else is.
  • Interface methods named _denormalize / _denormalizeNullable as TSMethodSignature — only the literal key denormalize is matched in that form. The same names are handled when written as declare fields or property signatures with a function type. Either rename to denormalize on the interface or edit the parameter list manually.
  • Custom helper functions that wrap (args, unvisit) and are passed around — update the helper signature and every caller.

Step 4: verify

  1. Run the type-checker. Residual errors about unvisit, visit, args, or delegate parameter counts point at code Step 3 missed.
  2. Run your test suite. Cache-invalidation regressions usually surface as stale denormalized values when args change — that signals a missing argsKey from Step 2.
  3. Grep for leftover patterns the codemod can't see:
    • denormalize( followed by three params, or normalize( with args, visit, delegate
    • bare unvisit( / visit( calls inside denormalize/normalize bodies
    • spread ...args inside denormalize/normalize bodies

Optional: Collection consolidation

Unrelated to delegate signatures: v0.18 lets a single Collection carry both argsKey and nestKey, so the same instance can back a top-level endpoint schema and a nested entity field. See Optional: consolidate Collection definitions in the v0.18 blog.

Reference

Frequently asked questions

What does the Data Client V0.18 Migration AI skill do?

Migrate @data-client codebases to v0.18 delegate signatures. Drives the v0.18 codemod and then handles the cases it cannot — especially registering argsKey for schemas whose output depends on endpoint args. Use when upgrading to v0.18, seeing TS errors about unvisit/visit/args/delegate signatures, or adapting custom Schema implementations.

Why use Data Client V0.18 Migration on TypingMind?

Because you install it once and use it with any model. Data Client V0.18 Migration is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Data Client V0.18 Migration in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/reactive/data-client/tree/master/.agents/skills/data-client-v0.18-migration. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Data Client V0.18 Migration?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Data Client V0.18 Migration?

As many as you like. As long as a model supports skills, you can use Data Client V0.18 Migration with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Data Client V0.18 Migration AI skill free?

Yes. It is published on GitHub by reactive under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇