From 95d7db9aac59770405ff6c7944e8967ced065641 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 16:43:32 +0000 Subject: [PATCH] docs(blog): Publish v0.19 post dated 2026-11-18 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Y5C5ZDDoStQ2tYZou5CYwj --- .../data-client-v0.19-migration/SKILL.md | 52 ++++----- .changeset/codemod-v0.19-improvements.md | 8 +- packages/codemods/README.md | 4 +- .../src/transforms/__tests__/v0.19.node.js | 106 +++++++++--------- packages/codemods/src/transforms/v0.19.js | 2 +- ...h-set.md => 2026-11-18-v0.19-batch-set.md} | 65 ++++++----- website/scripts/socialCard.mjs | 2 +- website/scripts/videos/README.md | 2 +- 8 files changed, 120 insertions(+), 121 deletions(-) rename website/blog/{2026-11-17-v0.19-batch-set.md => 2026-11-18-v0.19-batch-set.md} (96%) diff --git a/.agents/skills/data-client-v0.19-migration/SKILL.md b/.agents/skills/data-client-v0.19-migration/SKILL.md index f4a9a8a13c4b..6b806c889342 100644 --- a/.agents/skills/data-client-v0.19-migration/SKILL.md +++ b/.agents/skills/data-client-v0.19-migration/SKILL.md @@ -6,7 +6,7 @@ description: Upgrade apps that already use @data-client to v0.19. Runs the v0.19 # @data-client v0.19 Migration Every breaking change, with Before/After code: -[v0.19 migration guide](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#migration-guide). +[v0.19 migration guide](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#migration-guide). ## Step 1: bump and run the codemod @@ -35,7 +35,7 @@ skipped, including `.vue` and other single-file components. It used to return the data synchronously when fresh. Now it always returns a Promise, and a call you don't await never rejects unhandled: the error is stored for components, like any fetch error. -[Details](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise). +[Details](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise). Skip this step if `rg -n 'fetchIfStale' ` finds nothing. @@ -88,7 +88,7 @@ Skip this step unless the app uses `@data-client/ssr` (`DataClientDocument`, `Ap `pages/_app`). It stops at `@data-client/react` 0.14, and 0.19 supports only the App Router: render `DataProvider` from `@data-client/react/nextjs` in `app/layout.tsx`, then uninstall `@data-client/ssr` (and `@data-client/redux` if nothing else uses it). Moving pages to the App Router is a routing migration, so confirm with the owner before starting it. -[Details](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#nextjs-pages-router). +[Details](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#nextjs-pages-router). ## Step 5: custom Managers @@ -118,9 +118,9 @@ where it only returned a function, and gave Managers without middleware a pass-t the endpoint was `action.endpoint` under an `actionTypes.FETCH` check; fix each other `fetchedAt: Date.now()` that resolves a fetch action. -Details: [middleware](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-middleware), -[cleanup](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-cleanup), -[managers function](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#managers-function). +Details: [middleware](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-middleware), +[cleanup](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-cleanup), +[managers function](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#managers-function). ## Step 6: test helpers @@ -129,7 +129,7 @@ Details: [middleware](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#mana (the codemod adds both to lists of `new` calls), and the test's Managers now act on its actions. - **A custom Provider passed to [makeRenderDataHook()](https://dataclient.io/docs/api/makeRenderDataHook)** must accept `managers: () => Manager[]`, like `DataProvider`. - [Details](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#test-react-0.19). + [Details](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#test-react-0.19). ## Step 7: Vue @@ -147,7 +147,7 @@ processed. Skip this step if `rg -n '__DC_CONTROLLERS__' .` finds nothing. What' code that handled a missing store. Read `__DC__.controller`, after setting `__DC__.store = name` when the page has several stores. It throws when the store isn't mounted, where `.get(name)` returned `undefined`, so check `__DC__.stores.includes(name)` first where the store may be missing. -[Details](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#dc-global). +[Details](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#dc-global). ## Step 9: verify @@ -200,7 +200,7 @@ comment naming the replacement on the rest. Fix each, then delete the comment, a string, such as Managers that log or time requests by name: `rg -n "\.create['\"\`]" `. Then fix what's left of `rg -n 'waitForNextUpdate|createDataClient|actions(Black|White)list' `. The blog's -[future releases](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#future-releases) lists changes that will break +[future releases](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#future-releases) lists changes that will break later. ## Step 11: adopt 0.19 features (optional, own commit) @@ -218,7 +218,7 @@ It rewrites only code it can prove does the same thing, apart from the differenc release post's example; read it when a rewrite or a judgment call below is unclear. - A loop (`for...of`, `forEach()`, `rows.map()` or `Promise.all(rows.map())`) that calls `set()` once per row - becomes one [batch set()](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#batch-set): + becomes one [batch set()](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#batch-set): `ctrl.set([Ticker], rows)`. It batches only when: - each row is plain data, never an updater function: an object literal, a row of `JSON.parse()` without a reviver whose array the file only reads and doesn't export, or typed as the Entity or a plain object type; @@ -258,14 +258,14 @@ release post's example; read it when a rewrite or a judgment call below is uncle SSR from a server whose clock runs ahead), or when the list holds the same row object twice. - `ctrl.set([new Invalidate(Todo)], [{ id }])` becomes `ctrl.set(new Invalidate(Todo), { id })` - ([before/after](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#set-invalidate)). Its SET action's + ([before/after](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#set-invalidate)). Its SET action's `action.schema` is then the `Invalidate` instead of an Array. - Vue: `DataClientPlugin`'s `gcPolicy: new GCPolicy()` (now the default) is dropped, `GCPolicy` is imported from - `@data-client/vue` ([before/after](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#vue-gc)), and + `@data-client/vue` ([before/after](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#vue-gc)), and `computed(() => args)` passed to a composable becomes the getter `() => args` - ([before/after](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#vue-getter-args)). + ([before/after](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#vue-getter-args)). - `|| typeof data === 'symbol'` guards in conditions on React `useCache()` and `useDLE()` data are dropped - ([before/after](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#deleted-entity-undefined)). + ([before/after](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#deleted-entity-undefined)). Then, by judgment: @@ -279,27 +279,27 @@ Then, by judgment: `unshift` (a list goes in as given, one per row reverses it). A Manager that calls `set()` per message buffers messages and flushes them with one `set()` (skill "data-client-manager", batching). Batch `ctrl.fetch(getList.push, row)` loops into one array `push` only when the API accepts an array body, since it sends - one request instead of N. Examples: [batch set()](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#batch-set), - [push a list](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#push-list). + one request instead of N. Examples: [batch set()](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#batch-set), + [push a list](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#push-list). - **Remove casts 0.19 types made unnecessary**, then type-check; a cast whose removal fails reveals a value its schema doesn't describe, so fix the value instead: `as any` on `set()` args or values, `push`/`unshift`/`remove` bodies (also on Collections in a `Query` or `Lazy`), union `body` values, `FormData`, `getOptimisticResponse()` returns, a `Controller` subclass passed to `DataProvider`, `prepareStore()`'s store, `action.meta.promise`; and `as unknown as T[]` on `fetch(getList.push, list)` results. Type `process(value, params)` params from the endpoint by removing `params: any`. Examples: - [set() values](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#typed-set), - [process() params](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#extend-process-params), - [optimistic responses](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#typed-optimistic-response), - [push bodies](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#push-list), - [Collections in a Query](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#query-collection-push), - [FormData](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#create-formdata), - [union bodies](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#union-body), - [other types](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#type-fixes). + [set() values](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#typed-set), + [process() params](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#extend-process-params), + [optimistic responses](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#typed-optimistic-response), + [push bodies](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#push-list), + [Collections in a Query](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#query-collection-push), + [FormData](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#create-formdata), + [union bodies](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#union-body), + [other types](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#type-fixes). - **Vue**: `computed()` stored in a variable only to make composable args reactive can become a getter. Delete a Vitest `server.deps.inline` entry for `@data-client` added to fix `useEnhancedReducer is not a function` - ([details](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#testing)). + ([details](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#testing)). - **Cancellation**: a custom `Endpoint` that wraps an SDK call can pass `this.signal` on to it, without declaring - `this` ([example](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#endpoint-signal)). + `this` ([example](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#endpoint-signal)). ## Step 12: unlink the migration skills diff --git a/.changeset/codemod-v0.19-improvements.md b/.changeset/codemod-v0.19-improvements.md index 6ab20e71cf0b..18a7e72e7613 100644 --- a/.changeset/codemod-v0.19-improvements.md +++ b/.changeset/codemod-v0.19-improvements.md @@ -28,15 +28,15 @@ the same, apart from the differences noted below: server whose clock runs ahead), or when the list holds the same row object twice. - `ctrl.set([new Invalidate(Todo)], [{ id }])` becomes `ctrl.set(new Invalidate(Todo), { id })` - ([example](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#set-invalidate)). Its SET action's `action.schema` + ([example](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#set-invalidate)). Its SET action's `action.schema` is then the `Invalidate` instead of an Array. - Vue: drops `gcPolicy: new GCPolicy()`, now `DataClientPlugin`'s default - ([example](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#vue-gc)); imports `GCPolicy` from + ([example](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#vue-gc)); imports `GCPolicy` from `@data-client/vue` instead of `@data-client/core`; and replaces `computed(() => args)` passed to a composable with - the getter itself ([example](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#vue-getter-args)). + the getter itself ([example](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#vue-getter-args)). - Drops `|| typeof data === 'symbol'` (and `&& typeof data !== 'symbol'`) from conditions on React `useCache()` and `useDLE()` data, which is `undefined` instead of a Symbol - ([example](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#deleted-entity-undefined)). + ([example](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#deleted-entity-undefined)). ```ts ws.onmessage = event => { diff --git a/packages/codemods/README.md b/packages/codemods/README.md index 2b347ce78d09..4e5ca6b2f3af 100644 --- a/packages/codemods/README.md +++ b/packages/codemods/README.md @@ -12,7 +12,7 @@ npx @data-client/codemods v0.19 src/ | Codemod | Migrates | | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `v0.19` | `managers` arrays to functions that return them, `getMiddleware()` to `middleware`, `renderDataHook()`'s default Managers, [`fetchIfStale()`](https://dataclient.io/docs/api/Controller#fetchIfStale) Promise checks, mocks and missing-result handling, no-op catches on unawaited reads, [`controller.resolve()`](https://dataclient.io/docs/api/Controller#resolve)'s `fetchedAt`, `__DC_CONTROLLERS__` to `__DC__`, and deprecated APIs such as `resource().create` to `getList.push`, with a `TODO(data-client)` comment on what's left ([v0.19 post](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#migration-guide)) | +| `v0.19` | `managers` arrays to functions that return them, `getMiddleware()` to `middleware`, `renderDataHook()`'s default Managers, [`fetchIfStale()`](https://dataclient.io/docs/api/Controller#fetchIfStale) Promise checks, mocks and missing-result handling, no-op catches on unawaited reads, [`controller.resolve()`](https://dataclient.io/docs/api/Controller#resolve)'s `fetchedAt`, `__DC_CONTROLLERS__` to `__DC__`, and deprecated APIs such as `resource().create` to `getList.push`, with a `TODO(data-client)` comment on what's left ([v0.19 post](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#migration-guide)) | | `v0.18` | `Schema.denormalize()`/`normalize()` to the delegate signatures ([v0.18 post](https://dataclient.io/blog/2026/05/01/v0.18-scalar-typed-downloads)) | | `v0.16` | `path-to-regexp` v8 path syntax, `useFetch()` truthiness checks and `schema.X` imports ([v0.16 post](https://dataclient.io/blog/2026/04/01/v0.16-parallel-fetching-collection-move-lazy)) | | `v0.15` | `useDebounce()` results, `entityMeta`, `MemoCache` state and `INVALID` imports ([v0.15 post](https://dataclient.io/blog/2026/01/06/v0.15-vue-support-collection-remove)) | @@ -20,7 +20,7 @@ npx @data-client/codemods v0.19 src/ For `v0.19`, `--deprecations=false` skips deprecated APIs and `--deprecations=only` does just those, so they can go in their own commit. `--improvements=only` makes optional rewrites that adopt 0.19 features once you've upgraded: loops -that call `ctrl.set()` once per row become one [batch `set()`](https://dataclient.io/blog/2026/11/17/v0.19-batch-set#batch-set), +that call `ctrl.set()` once per row become one [batch `set()`](https://dataclient.io/blog/2026/11/18/v0.19-batch-set#batch-set), and code that worked around older limits, like `computed()` around Vue composable args, is simplified. A batch runs only `if (rows.length)` (unless its list is an array literal without a spread). diff --git a/packages/codemods/src/transforms/__tests__/v0.19.node.js b/packages/codemods/src/transforms/__tests__/v0.19.node.js index b4279fcc2940..a031523965e2 100644 --- a/packages/codemods/src/transforms/__tests__/v0.19.node.js +++ b/packages/codemods/src/transforms/__tests__/v0.19.node.js @@ -120,7 +120,7 @@ const network = managers.find(m => m instanceof NetworkManager); export function App() { const memoized = useMemo(() => getDefaultManagers(), []); - // TODO(data-client): managers runs once per store since 0.19; create the Managers inside this function so stores don't share them, or pass the function itself if it already is one: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#managers-function + // TODO(data-client): managers runs once per store since 0.19; create the Managers inside this function so stores don't share them, or pass the function itself if it already is one: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#managers-function return ( <> managers} /> @@ -183,7 +183,7 @@ import { DataProvider, getDefaultManagers } from '@data-client/react'; const managers = getDefaultManagers(); -// TODO(data-client): managers runs once per store since 0.19; create the Managers inside this function so stores don't share them, or pass the function itself if it already is one: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#managers-function +// TODO(data-client): managers runs once per store since 0.19; create the Managers inside this function so stores don't share them, or pass the function itself if it already is one: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#managers-function export const A = () => ( managers}> @@ -232,7 +232,7 @@ import { DataClientPlugin } from '@data-client/vue'; import { mountDataClient } from '@data-client/vue/test'; const customManagers = [new NetworkManager()]; -// TODO(data-client): managers runs once per store since 0.19; create the Managers inside this function so stores don't share them, or pass the function itself if it already is one: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#managers-function +// TODO(data-client): managers runs once per store since 0.19; create the Managers inside this function so stores don't share them, or pass the function itself if it already is one: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#managers-function mount(Comp, { global: { plugins: [[DataClientPlugin, { managers: () => customManagers }]] } }); customManagers[0].cleanup(); mountDataClient(Comp, { managers: () => [new NetworkManager()] }); @@ -254,7 +254,7 @@ import { renderDataHook } from '@data-client/test'; import { SubscriptionManager, PollingSubscription } from '@data-client/react'; -// TODO(data-client): managers runs once per store since 0.19; create the Managers inside this function so stores don't share them, or pass the function itself if it already is one: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#managers-function +// TODO(data-client): managers runs once per store since 0.19; create the Managers inside this function so stores don't share them, or pass the function itself if it already is one: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#managers-function renderDataHook(() => useThing(), { managers: () => [new NetworkManager(), logger] }); renderDataClient(() => useThing(), { managers: () => [new NetworkManager(), new SubscriptionManager(PollingSubscription)] }); `, @@ -278,7 +278,7 @@ import { NetworkManager, SubscriptionManager, PollingSubscription } from '@data- renderDataHook(() => useThing(), { managers: () => [new LoggingManager(), new NetworkManager(), new SubscriptionManager(PollingSubscription)] }); renderDataHook(() => useThing(), { managers: () => [new AuditNetworkManager(), new SubscriptionManager(PollingSubscription)] }); -// TODO(data-client): managers runs once per store since 0.19; create the Managers inside this function so stores don't share them, or pass the function itself if it already is one: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#managers-function +// TODO(data-client): managers runs once per store since 0.19; create the Managers inside this function so stores don't share them, or pass the function itself if it already is one: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#managers-function renderDataHook(() => useThing(), { managers: () => [logger] }); `, 'adds the default Managers renderDataHook() lists of new Managers lack', @@ -457,7 +457,7 @@ const [CustomProvider] = createPersistedStore(useCustom ? custom : undefined); import { createPersistedStore } from '@data-client/react'; const [ServerProvider] = createPersistedStore(undefined, false); -// TODO(data-client): managers runs once per store since 0.19; create the Managers inside this function so stores don't share them, or pass the function itself if it already is one: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#managers-function +// TODO(data-client): managers runs once per store since 0.19; create the Managers inside this function so stores don't share them, or pass the function itself if it already is one: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#managers-function const [CustomProvider] = createPersistedStore(useCustom ? () => custom : undefined); `, 'leaves undefined managers arguments alone, including conditional ones', @@ -524,19 +524,19 @@ class C implements Manager { import type { Manager, Middleware } from '@data-client/react'; class A implements Manager { - // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-middleware + // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-middleware getMiddleware() { return; } cleanup() {} } class B implements Manager { - // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-middleware + // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-middleware getMiddleware: Middleware; cleanup() {} } class C implements Manager { - // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-middleware + // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-middleware static getMiddleware() { return controller => next => next; } @@ -566,10 +566,10 @@ import { NetworkManager } from '@data-client/react'; class LiveManager { constructor() { - // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-middleware + // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-middleware this.getMiddleware = this.getMiddleware.bind(this); } - // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-middleware + // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-middleware getMiddleware() { return controller => next => next; } @@ -626,19 +626,19 @@ const mw = new LoggingManager().getMiddleware(); import { Manager, Middleware } from '@data-client/react'; class LoggingManager implements Manager { - // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-middleware + // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-middleware getMiddleware() { return controller => next => next; } } class Both implements Manager { middleware: Middleware = controller => next => action => next(action); - // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-middleware + // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-middleware getMiddleware() { return controller => next => next; } } -// TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-middleware +// TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-middleware const mw = new LoggingManager().getMiddleware(); `, 'keeps every getMiddleware when one beside a middleware property cannot convert', @@ -661,12 +661,12 @@ const mw = manager.getMiddleware(); import { NetworkManager } from '@data-client/react'; const manager = { - // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-middleware + // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-middleware getMiddleware() { return controller => next => next; }, }; -// TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-middleware +// TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-middleware const mw = manager.getMiddleware(); `, 'marks object-literal getMiddleware and keeps its calls', @@ -707,7 +707,7 @@ class Boss implements Manager {} import { useSuspense } from '@data-client/react'; import { Manager } from './types'; -// TODO(data-client): if this is a data-client Manager, it throws on mount without a middleware property since 0.19; add \`middleware: Middleware = () => next => next\`: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-middleware +// TODO(data-client): if this is a data-client Manager, it throws on mount without a middleware property since 0.19; add \`middleware: Middleware = () => next => next\`: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-middleware class Boss implements Manager {} `, 'marks classes implementing a Manager from another module', @@ -719,10 +719,10 @@ class Boss implements Manager {} ` import { NetworkManager } from '@data-client/react'; -function f(nm) { foo(); // TODO(data-client): NetworkManager.cleanupDate was removed in 0.19: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-cleanup +function f(nm) { foo(); // TODO(data-client): NetworkManager.cleanupDate was removed in 0.19: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-cleanup return nm.cleanupDate; } function g(nm) { - // TODO(data-client): NetworkManager.cleanupDate was removed in 0.19: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-cleanup + // TODO(data-client): NetworkManager.cleanupDate was removed in 0.19: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-cleanup if (nm) return nm.cleanupDate; } @@ -730,10 +730,10 @@ function g(nm) { ` import { NetworkManager } from '@data-client/react'; -function f(nm) { foo(); // TODO(data-client): NetworkManager.cleanupDate was removed in 0.19: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-cleanup +function f(nm) { foo(); // TODO(data-client): NetworkManager.cleanupDate was removed in 0.19: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-cleanup return nm.cleanupDate; } function g(nm) { - // TODO(data-client): NetworkManager.cleanupDate was removed in 0.19: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-cleanup + // TODO(data-client): NetworkManager.cleanupDate was removed in 0.19: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-cleanup if (nm) return nm.cleanupDate; } @@ -755,7 +755,7 @@ function g(nm) { import { NetworkManager } from '@data-client/react'; function g(nm) { - // TODO(data-client): NetworkManager.cleanupDate was removed in 0.19: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-cleanup + // TODO(data-client): NetworkManager.cleanupDate was removed in 0.19: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-cleanup if (nm) return nm.cleanupDate; } @@ -840,7 +840,7 @@ const App = () => ( import { DataProvider, NetworkManager, type Manager } from '@data-client/react'; const network = new NetworkManager(); -// TODO(data-client): managers runs once per store since 0.19; create the Managers inside this function so stores don't share them, or pass the function itself if it already is one: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#managers-function +// TODO(data-client): managers runs once per store since 0.19; create the Managers inside this function so stores don't share them, or pass the function itself if it already is one: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#managers-function const App = () => ( <> [network, new MyManager()]} /> @@ -874,7 +874,7 @@ const mw = manager.getMiddleware(); import { Manager, NetworkManager } from '@data-client/react'; class A implements Manager { - // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-middleware + // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-middleware async getMiddleware() { return controller => next => next; } @@ -884,7 +884,7 @@ class C implements Manager { ['middleware'] = () => next => next; ['getMiddleware2']() {} } -// TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-middleware +// TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-middleware const mw = manager.getMiddleware(); `, 'marks async getMiddleware and its calls; leaves subclasses and existing middleware alone', @@ -941,7 +941,7 @@ class Lazy extends NetworkManager { import { NetworkManager } from '@data-client/react'; class Lazy extends NetworkManager { - // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-middleware + // TODO(data-client): getMiddleware() was removed in 0.19; define a middleware property: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-middleware getMiddleware() { const mw = super.getMiddleware(); return mw; @@ -993,7 +993,7 @@ import { NetworkManager } from '@data-client/react'; export default class AuditNetworkManager extends NetworkManager { cleanup() { super.cleanup(); - // TODO(data-client): NetworkManager.cleanupDate was removed in 0.19: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#manager-cleanup + // TODO(data-client): NetworkManager.cleanupDate was removed in 0.19: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#manager-cleanup console.info(this.cleanupDate); } } @@ -1018,7 +1018,7 @@ import { DataProvider, getDefaultManagers } from '@data-client/react'; export const managers = [new MyManager(), ...getDefaultManagers()]; -// TODO(data-client): managers runs once per store since 0.19; create the Managers inside this function so stores don't share them, or pass the function itself if it already is one: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#managers-function +// TODO(data-client): managers runs once per store since 0.19; create the Managers inside this function so stores don't share them, or pass the function itself if it already is one: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#managers-function export const App = () => managers} />; `, 'wraps exported arrays where they are passed, as their importers are, with a TODO', @@ -1090,11 +1090,11 @@ import type { Controller } from '@data-client/react'; export function loader(ctrl: Controller, id: number, value: unknown) { const issue = ctrl.fetchIfStale(IssueResource.get, { id }); - // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise + // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise if (!(issue instanceof Promise)) { render(issue); } - // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise + // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise if (value) { log(value); } else if (ctrl.fetchIfStale(IssueResource.get, { id }) instanceof Promise) { @@ -1127,14 +1127,14 @@ import { Controller } from '@data-client/react'; export async function loader(ctrl, id) { const issue = ctrl.fetchIfStale(IssueResource.get, { id }); - // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise + // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise const { title } = ctrl.fetchIfStale(IssueResource.get, { id }); - // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise + // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise if (ctrl.fetchIfStale(UserResource.get, { id })) { log(title); } const user = ctrl.fetchIfStale(UserResource.get, { id }) as User; - // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise + // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise return \`\${issue.title} by \${user.name}\`; } `, @@ -1245,7 +1245,7 @@ export async function issueLoader(ctrl: Controller, id: number) { const org = ctrl.fetchIfStale(OrgResource.get, { id }); await org; const repo = ctrl.fetchIfStale(RepoResource.get, { id }); - // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise + // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise if (repo instanceof Promise) return; render(repo); @@ -1304,7 +1304,7 @@ const fallthrough = { fetchIfStale: jest.fn(async () => { }) }; jest.spyOn(real, 'fetchIfStale').mockImplementation(async () => issue); jest.spyOn(real, 'fetchIfStale').mockImplementationOnce(() => Promise.reject(error)); -// TODO(data-client): fetchIfStale() always returns a Promise since 0.19; make this mock resolve its data: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise +// TODO(data-client): fetchIfStale() always returns a Promise since 0.19; make this mock resolve its data: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise jest.spyOn(real, 'fetchIfStale').mockImplementation(impl); `, 'makes jest.fn() mocks of fetchIfStale resolve their value', @@ -1371,7 +1371,7 @@ import type { Controller } from '@data-client/react'; export async function guarded(ctrl: Controller, id: string) { const issue = ctrl.fetchIfStale(IssueResource.get, { id }); - // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise + // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise if (issue instanceof Promise) { await issue; return; @@ -1380,11 +1380,11 @@ export async function guarded(ctrl: Controller, id: string) { } export async function counted(ctrl: Controller, id: string) { const issue = ctrl.fetchIfStale(IssueResource.get, { id }); - // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise + // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise if (issue instanceof Promise) { await issue; } else { - // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise + // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise recordCacheHit(issue.id); } } @@ -1408,18 +1408,18 @@ export async function shadowed(ctrl: Controller, id: string, kind: string) { export async function looped(ctrl: Controller, ids: string[]) { for (const id of ids) { const issue = ctrl.fetchIfStale(IssueResource.get, { id }); - // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise + // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise if (issue instanceof Promise) { await issue; continue; } - // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise + // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise recordCacheHit(issue.id); } } export async function title(ctrl: Controller, id: string) { const data = await ctrl.fetchIfStale(IssueResource.get, { id }); - // TODO(data-client): an awaited fetchIfStale() rejects, instead of resolving undefined, when the latest fetch failed since 0.19; handle that case in .catch() or try/catch: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise + // TODO(data-client): an awaited fetchIfStale() rejects, instead of resolving undefined, when the latest fetch failed since 0.19; handle that case in .catch() or try/catch: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise return data?.title; } `, @@ -1447,13 +1447,13 @@ import type { Controller } from '@data-client/react'; export async function settingsLoader(ctrl: Controller) { const settings = await ctrl.fetchIfStale(SettingsResource.get, { id: 'me' }); - // TODO(data-client): an awaited fetchIfStale() rejects, instead of resolving undefined, when the latest fetch failed since 0.19; handle that case in .catch() or try/catch: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise + // TODO(data-client): an awaited fetchIfStale() rejects, instead of resolving undefined, when the latest fetch failed since 0.19; handle that case in .catch() or try/catch: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise if (!settings) log('no settings'); - // TODO(data-client): an awaited fetchIfStale() rejects, instead of resolving undefined, when the latest fetch failed since 0.19; handle that case in .catch() or try/catch: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise + // TODO(data-client): an awaited fetchIfStale() rejects, instead of resolving undefined, when the latest fetch failed since 0.19; handle that case in .catch() or try/catch: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise const theme = (await ctrl.fetchIfStale(ThemeResource.get)) ?? DEFAULT_THEME; const user = await ctrl.fetchIfStale(UserResource.get, { id }); - // TODO(data-client): an awaited fetchIfStale() rejects, instead of resolving undefined, when the latest fetch failed since 0.19; handle that case in .catch() or try/catch: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise + // TODO(data-client): an awaited fetchIfStale() rejects, instead of resolving undefined, when the latest fetch failed since 0.19; handle that case in .catch() or try/catch: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise if (user == null) return; const issue = await ctrl.fetchIfStale(IssueResource.get, { id }); @@ -1569,7 +1569,7 @@ export function f(ctrl, id) { import { useController } from '@data-client/react'; export function f(ctrl, id) { var issue = ctrl.fetchIfStale(IssueResource.get, { id }); - // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise + // TODO(data-client): fetchIfStale() always returns a Promise since 0.19; await it to read the data: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise if (!(issue instanceof Promise)) render(issue); } @@ -1862,7 +1862,7 @@ for (const controller of __DC_CONTROLLERS__.values()) log(controller); globalThis.__DC__.store = 'Data Client: Chat'; copy(JSON.stringify(globalThis.__DC__.controller.getState())); -// TODO(data-client): __DC_CONTROLLERS__ was replaced by __DC__ in 0.19; read __DC__.controller, after setting __DC__.store when the page has several stores (it throws when the store is missing): https://dataclient.io/blog/2026/11/17/v0.19-batch-set#dc-global +// TODO(data-client): __DC_CONTROLLERS__ was replaced by __DC__ in 0.19; read __DC__.controller, after setting __DC__.store when the page has several stores (it throws when the store is missing): https://dataclient.io/blog/2026/11/18/v0.19-batch-set#dc-global const first = [...window.__DC_CONTROLLERS__.values()][0]; const names = window.__DC__.stores; const ids = __DC__.stores; @@ -1873,14 +1873,14 @@ diff((__DC__.store = 'Admin', __DC__.controller).getState(), (__DC__.store = 'Sh const store = pick(), picked = (__DC__.store = store, __DC__.controller); const pair = [name = next(), (__DC__.store = name, __DC__.controller)]; f([name] = next(), (__DC__.store = name, __DC__.controller)); -// TODO(data-client): __DC_CONTROLLERS__ was replaced by __DC__ in 0.19; read __DC__.controller, after setting __DC__.store when the page has several stores (it throws when the store is missing): https://dataclient.io/blog/2026/11/17/v0.19-batch-set#dc-global +// TODO(data-client): __DC_CONTROLLERS__ was replaced by __DC__ in 0.19; read __DC__.controller, after setting __DC__.store when the page has several stores (it throws when the store is missing): https://dataclient.io/blog/2026/11/18/v0.19-batch-set#dc-global const framed = getWindow().__DC_CONTROLLERS__.get('app').getState(); -// TODO(data-client): __DC_CONTROLLERS__ was replaced by __DC__ in 0.19; read __DC__.controller, after setting __DC__.store when the page has several stores (it throws when the store is missing): https://dataclient.io/blog/2026/11/17/v0.19-batch-set#dc-global +// TODO(data-client): __DC_CONTROLLERS__ was replaced by __DC__ in 0.19; read __DC__.controller, after setting __DC__.store when the page has several stores (it throws when the store is missing): https://dataclient.io/blog/2026/11/18/v0.19-batch-set#dc-global const ctrl = __DC_CONTROLLERS__.get(name); if (!ctrl) return null; -// TODO(data-client): __DC_CONTROLLERS__ was replaced by __DC__ in 0.19; read __DC__.controller, after setting __DC__.store when the page has several stores (it throws when the store is missing): https://dataclient.io/blog/2026/11/17/v0.19-batch-set#dc-global +// TODO(data-client): __DC_CONTROLLERS__ was replaced by __DC__ in 0.19; read __DC__.controller, after setting __DC__.store when the page has several stores (it throws when the store is missing): https://dataclient.io/blog/2026/11/18/v0.19-batch-set#dc-global const maybeState = __DC_CONTROLLERS__.get('c')?.getState(); -// TODO(data-client): __DC_CONTROLLERS__ was replaced by __DC__ in 0.19; read __DC__.controller, after setting __DC__.store when the page has several stores (it throws when the store is missing): https://dataclient.io/blog/2026/11/17/v0.19-batch-set#dc-global +// TODO(data-client): __DC_CONTROLLERS__ was replaced by __DC__ in 0.19; read __DC__.controller, after setting __DC__.store when the page has several stores (it throws when the store is missing): https://dataclient.io/blog/2026/11/18/v0.19-batch-set#dc-global for (const controller of __DC_CONTROLLERS__.values()) log(controller); `, @@ -1906,7 +1906,7 @@ const n = __DC_CONTROLLERS__.get('a'); const c = __DC_CONTROLLERS__.get(...storeArgs); `, ` -// TODO(data-client): __DC_CONTROLLERS__ was replaced by __DC__ in 0.19; read __DC__.controller, after setting __DC__.store when the page has several stores (it throws when the store is missing): https://dataclient.io/blog/2026/11/17/v0.19-batch-set#dc-global +// TODO(data-client): __DC_CONTROLLERS__ was replaced by __DC__ in 0.19; read __DC__.controller, after setting __DC__.store when the page has several stores (it throws when the store is missing): https://dataclient.io/blog/2026/11/18/v0.19-batch-set#dc-global const c = __DC_CONTROLLERS__.get(...storeArgs); `, 'marks a lookup with a spread argument', @@ -2533,7 +2533,7 @@ class Member extends User { } } class Sorted extends Entity { - // TODO(data-client): a future release types Entity.pk() args as readonly any[]; make this parameter readonly: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#future-pk-args + // TODO(data-client): a future release types Entity.pk() args as readonly any[]; make this parameter readonly: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#future-pk-args static pk(value: any, parent?: any, key?: string, args?: any[]) { return args?.sort().join(','); } @@ -2549,7 +2549,7 @@ class Grouped extends Entity { } } class Named extends Entity { - // TODO(data-client): a future release types Entity.pk() args as readonly any[]; make this parameter readonly: https://dataclient.io/blog/2026/11/17/v0.19-batch-set#future-pk-args + // TODO(data-client): a future release types Entity.pk() args as readonly any[]; make this parameter readonly: https://dataclient.io/blog/2026/11/18/v0.19-batch-set#future-pk-args static pk(value: any, parent?: any, key?: string, args?: Args) { return value.id; } diff --git a/packages/codemods/src/transforms/v0.19.js b/packages/codemods/src/transforms/v0.19.js index 22f5f87324fd..1611ef81e8f8 100644 --- a/packages/codemods/src/transforms/v0.19.js +++ b/packages/codemods/src/transforms/v0.19.js @@ -81,7 +81,7 @@ const DATA_CLIENT_PREFIX = '@data-client/'; // every rewrite outside the deprecated APIs needs one of these names in the file const NAMES = /managers|initManager|prepareStore|createPersistedStore|fetchIfStale|getMiddleware|cleanupDate|\bManager\b|fetchedAt|\.catch\(/; -const BLOG = 'https://dataclient.io/blog/2026/11/17/v0.19-batch-set'; +const BLOG = 'https://dataclient.io/blog/2026/11/18/v0.19-batch-set'; // calls whose object argument has a `managers` option const OPTION_CALLS = new Set([ 'createDataClient', diff --git a/website/blog/2026-11-17-v0.19-batch-set.md b/website/blog/2026-11-18-v0.19-batch-set.md similarity index 96% rename from website/blog/2026-11-17-v0.19-batch-set.md rename to website/blog/2026-11-18-v0.19-batch-set.md index 95e8b41296d4..9733199b87ce 100644 --- a/website/blog/2026-11-17-v0.19-batch-set.md +++ b/website/blog/2026-11-18-v0.19-batch-set.md @@ -4,7 +4,6 @@ description: Write many entities in one store update with Controller.set([Entity image: /img/social/0.19-card.png authors: [ntucker] tags: [releases, performance, managers, vue, native, rest, schema, collection, validation] -draft: true --- import useBaseUrl from '@docusaurus/useBaseUrl'; @@ -33,8 +32,8 @@ endpoint code about 2x faster, and fixes a round of TypeScript and Vue issues. Coding agents also get a Claude Code plugin, Vue skills, a performance-pass skill and llms.txt; see [Data Client for Coding Agents](/blog/2026/10/06/coding-agents). -**[Batch Controller.set()](/blog/2026/11/17/v0.19-batch-set#batch-set)** writes a whole stream of rows, like price tickers from a websocket, in one -store update with `ctrl.set([Ticker], rows)`. That is [up to 95x faster](/blog/2026/11/17/v0.19-batch-set#batch-set-performance) than one `set()` per row. +**[Batch Controller.set()](/blog/2026/11/18/v0.19-batch-set#batch-set)** writes a whole stream of rows, like price tickers from a websocket, in one +store update with `ctrl.set([Ticker], rows)`. That is [up to 95x faster](/blog/2026/11/18/v0.19-batch-set#batch-set-performance) than one `set()` per row. @@ -48,7 +47,7 @@ store update with `ctrl.set([Ticker], rows)`. That is [up to 95x faster](/blog/2 ]} /> -**[Faster TypeScript](/blog/2026/11/17/v0.19-batch-set#faster-types)**: editors and `tsc` check [RestEndpoint](/rest/api/RestEndpoint) and +**[Faster TypeScript](/blog/2026/11/18/v0.19-batch-set#faster-types)**: editors and `tsc` check [RestEndpoint](/rest/api/RestEndpoint) and [resource()](/rest/api/resource) code about 2x faster with 40% less memory, and still report every error they reported before. @@ -66,35 +65,35 @@ before. **More in v0.19:** -- [Performance](/blog/2026/11/17/v0.19-batch-set#performance): [faster Redux DevTools](/blog/2026/11/17/v0.19-batch-set#devtools-perf) and [smaller split bundles](/blog/2026/11/17/v0.19-batch-set#smaller-chunks) -- [Client](/blog/2026/11/17/v0.19-batch-set#client): [delete one entity with set()](/blog/2026/11/17/v0.19-batch-set#set-invalidate), [unawaited reads need no `.catch()`](/blog/2026/11/17/v0.19-batch-set#fetch-read-prehandled), [`` above DataProvider](/blog/2026/11/17/v0.19-batch-set#loading-error-fixes), and [loading and error fixes](/blog/2026/11/17/v0.19-batch-set#loading-error-states) -- [Platforms](/blog/2026/11/17/v0.19-batch-set#platforms): [React Native 0.87, shorter React Native GC pauses, and Babel 8](/blog/2026/11/17/v0.19-batch-set#platforms) -- [Vue](/blog/2026/11/17/v0.19-batch-set#vue): [garbage collection by default](/blog/2026/11/17/v0.19-batch-set#vue-gc), [stale-while-revalidate](/blog/2026/11/17/v0.19-batch-set#vue-stale-while-revalidate) and [getter arguments](/blog/2026/11/17/v0.19-batch-set#vue-getter-args) -- [Collections](/blog/2026/11/17/v0.19-batch-set#collection-updates): [lists of items](/blog/2026/11/17/v0.19-batch-set#push-list) in every update, and [each item shown once](/blog/2026/11/17/v0.19-batch-set#collection-order) -- [Validation](/blog/2026/11/17/v0.19-batch-set#validation): [typed `set()` values](/blog/2026/11/17/v0.19-batch-set#typed-set), [`process()` params](/blog/2026/11/17/v0.19-batch-set#extend-process-params) and [optimistic responses](/blog/2026/11/17/v0.19-batch-set#typed-optimistic-response); [testing](/blog/2026/11/17/v0.19-batch-set#testing) and [warning](/blog/2026/11/17/v0.19-batch-set#warnings) fixes - -**[Breaking Changes:](/blog/2026/11/17/v0.19-batch-set#migration-guide)** - -- [For all users](/blog/2026/11/17/v0.19-batch-set#migrate-all) - - [The Next.js Pages Router is not supported](/blog/2026/11/17/v0.19-batch-set#nextjs-pages-router); use the App Router ([#4648](https://github.com/reactive/data-client/pull/4648)) - - [TypeScript 4.0 or later is required](/blog/2026/11/17/v0.19-batch-set#typescript-4) - the TypeScript 3.x declarations are removed ([#4151](https://github.com/reactive/data-client/pull/4151)) - - [`managers` is a function that creates each store's Managers](/blog/2026/11/17/v0.19-batch-set#managers-function); `npx @data-client/codemods v0.19 src/` converts arrays ([#4601](https://github.com/reactive/data-client/pull/4601)) - - [Controller.fetchIfStale() always returns a Promise](/blog/2026/11/17/v0.19-batch-set#fetch-if-stale-promise), so prefetches need no `.catch()` ([#4657](https://github.com/reactive/data-client/pull/4657)) - - [`__DC_CONTROLLERS__` is now `__DC__`](/blog/2026/11/17/v0.19-batch-set#dc-global) for debugging scripts ([#4435](https://github.com/reactive/data-client/pull/4435)) -- [For custom Manager authors](/blog/2026/11/17/v0.19-batch-set#custom-managers) - - [Managers must define `middleware`](/blog/2026/11/17/v0.19-batch-set#manager-middleware) - `getMiddleware()` is removed ([#4378](https://github.com/reactive/data-client/pull/4378), [#4382](https://github.com/reactive/data-client/pull/4382)) - - [Manager `cleanup()` no longer means the store is gone](/blog/2026/11/17/v0.19-batch-set#manager-cleanup) - start timers and connections in `init()`, and `NetworkManager.cleanupDate` is removed ([#4593](https://github.com/reactive/data-client/pull/4593)) -- [For test authors](/blog/2026/11/17/v0.19-batch-set#migrate-tests) - - [@data-client/test requires @data-client/react 0.19](/blog/2026/11/17/v0.19-batch-set#test-react-0.19) ([#4414](https://github.com/reactive/data-client/pull/4414), [#4601](https://github.com/reactive/data-client/pull/4601)) - - [React Native tests need @testing-library/react-native](/blog/2026/11/17/v0.19-batch-set#test-react-native) ([#4595](https://github.com/reactive/data-client/pull/4595)) - -**[Get ready for future releases:](/blog/2026/11/17/v0.19-batch-set#future-releases)** - -- [Type `args` as `readonly` in `Entity.pk()` overrides](/blog/2026/11/17/v0.19-batch-set#future-pk-args) -- [Use `DataClientPlugin` instead of Vue `createDataClient()`](/blog/2026/11/17/v0.19-batch-set#future-create-data-client) -- [Replace `waitForNextUpdate()` in Vue tests](/blog/2026/11/17/v0.19-batch-set#future-wait-for-next-update) - -**[Adopt new features:](/blog/2026/11/17/v0.19-batch-set#adopt-features)** `npx @data-client/codemods v0.19 src/ --improvements=only` batches `set()` loops and drops workarounds 0.19 makes unnecessary +- [Performance](/blog/2026/11/18/v0.19-batch-set#performance): [faster Redux DevTools](/blog/2026/11/18/v0.19-batch-set#devtools-perf) and [smaller split bundles](/blog/2026/11/18/v0.19-batch-set#smaller-chunks) +- [Client](/blog/2026/11/18/v0.19-batch-set#client): [delete one entity with set()](/blog/2026/11/18/v0.19-batch-set#set-invalidate), [unawaited reads need no `.catch()`](/blog/2026/11/18/v0.19-batch-set#fetch-read-prehandled), [`` above DataProvider](/blog/2026/11/18/v0.19-batch-set#loading-error-fixes), and [loading and error fixes](/blog/2026/11/18/v0.19-batch-set#loading-error-states) +- [Platforms](/blog/2026/11/18/v0.19-batch-set#platforms): [React Native 0.87, shorter React Native GC pauses, and Babel 8](/blog/2026/11/18/v0.19-batch-set#platforms) +- [Vue](/blog/2026/11/18/v0.19-batch-set#vue): [garbage collection by default](/blog/2026/11/18/v0.19-batch-set#vue-gc), [stale-while-revalidate](/blog/2026/11/18/v0.19-batch-set#vue-stale-while-revalidate) and [getter arguments](/blog/2026/11/18/v0.19-batch-set#vue-getter-args) +- [Collections](/blog/2026/11/18/v0.19-batch-set#collection-updates): [lists of items](/blog/2026/11/18/v0.19-batch-set#push-list) in every update, and [each item shown once](/blog/2026/11/18/v0.19-batch-set#collection-order) +- [Validation](/blog/2026/11/18/v0.19-batch-set#validation): [typed `set()` values](/blog/2026/11/18/v0.19-batch-set#typed-set), [`process()` params](/blog/2026/11/18/v0.19-batch-set#extend-process-params) and [optimistic responses](/blog/2026/11/18/v0.19-batch-set#typed-optimistic-response); [testing](/blog/2026/11/18/v0.19-batch-set#testing) and [warning](/blog/2026/11/18/v0.19-batch-set#warnings) fixes + +**[Breaking Changes:](/blog/2026/11/18/v0.19-batch-set#migration-guide)** + +- [For all users](/blog/2026/11/18/v0.19-batch-set#migrate-all) + - [The Next.js Pages Router is not supported](/blog/2026/11/18/v0.19-batch-set#nextjs-pages-router); use the App Router ([#4648](https://github.com/reactive/data-client/pull/4648)) + - [TypeScript 4.0 or later is required](/blog/2026/11/18/v0.19-batch-set#typescript-4) - the TypeScript 3.x declarations are removed ([#4151](https://github.com/reactive/data-client/pull/4151)) + - [`managers` is a function that creates each store's Managers](/blog/2026/11/18/v0.19-batch-set#managers-function); `npx @data-client/codemods v0.19 src/` converts arrays ([#4601](https://github.com/reactive/data-client/pull/4601)) + - [Controller.fetchIfStale() always returns a Promise](/blog/2026/11/18/v0.19-batch-set#fetch-if-stale-promise), so prefetches need no `.catch()` ([#4657](https://github.com/reactive/data-client/pull/4657)) + - [`__DC_CONTROLLERS__` is now `__DC__`](/blog/2026/11/18/v0.19-batch-set#dc-global) for debugging scripts ([#4435](https://github.com/reactive/data-client/pull/4435)) +- [For custom Manager authors](/blog/2026/11/18/v0.19-batch-set#custom-managers) + - [Managers must define `middleware`](/blog/2026/11/18/v0.19-batch-set#manager-middleware) - `getMiddleware()` is removed ([#4378](https://github.com/reactive/data-client/pull/4378), [#4382](https://github.com/reactive/data-client/pull/4382)) + - [Manager `cleanup()` no longer means the store is gone](/blog/2026/11/18/v0.19-batch-set#manager-cleanup) - start timers and connections in `init()`, and `NetworkManager.cleanupDate` is removed ([#4593](https://github.com/reactive/data-client/pull/4593)) +- [For test authors](/blog/2026/11/18/v0.19-batch-set#migrate-tests) + - [@data-client/test requires @data-client/react 0.19](/blog/2026/11/18/v0.19-batch-set#test-react-0.19) ([#4414](https://github.com/reactive/data-client/pull/4414), [#4601](https://github.com/reactive/data-client/pull/4601)) + - [React Native tests need @testing-library/react-native](/blog/2026/11/18/v0.19-batch-set#test-react-native) ([#4595](https://github.com/reactive/data-client/pull/4595)) + +**[Get ready for future releases:](/blog/2026/11/18/v0.19-batch-set#future-releases)** + +- [Type `args` as `readonly` in `Entity.pk()` overrides](/blog/2026/11/18/v0.19-batch-set#future-pk-args) +- [Use `DataClientPlugin` instead of Vue `createDataClient()`](/blog/2026/11/18/v0.19-batch-set#future-create-data-client) +- [Replace `waitForNextUpdate()` in Vue tests](/blog/2026/11/18/v0.19-batch-set#future-wait-for-next-update) + +**[Adopt new features:](/blog/2026/11/18/v0.19-batch-set#adopt-features)** `npx @data-client/codemods v0.19 src/ --improvements=only` batches `set()` loops and drops workarounds 0.19 makes unnecessary {/* truncate */} diff --git a/website/scripts/socialCard.mjs b/website/scripts/socialCard.mjs index 8075e6129af6..596e58d973e2 100644 --- a/website/scripts/socialCard.mjs +++ b/website/scripts/socialCard.mjs @@ -3,7 +3,7 @@ * from the post's frontmatter and summary bullets. * * Usage (from repo root): - * yarn workspace rdc-website social-card blog/2026-11-17-v0.19-batch-set.md + * yarn workspace rdc-website social-card blog/2026-11-18-v0.19-batch-set.md * yarn workspace rdc-website social-card 0.19 --force # overwrite existing * yarn workspace rdc-website social-card coding-agents # non-release post, by slug * diff --git a/website/scripts/videos/README.md b/website/scripts/videos/README.md index 66857ff951e2..b8cb08439fd2 100644 --- a/website/scripts/videos/README.md +++ b/website/scripts/videos/README.md @@ -29,7 +29,7 @@ connection with the extension's Inspector monitor (`@redux-devtools/inspector-mo | Clip | Shows | Embedded in | | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------- | -| `batch-set-devtools` | Coin app `StreamManager` bursts of 500 ticker messages: per-message `set()` vs batched | `blog/2026-11-17-v0.19-batch-set.md` | +| `batch-set-devtools` | Coin app `StreamManager` bursts of 500 ticker messages: per-message `set()` vs batched | `blog/2026-11-18-v0.19-batch-set.md` | | `normalization` (pre-rendered by @ntucker, see below) | Explainer: duplicate copies, one entity per id, denormalize, one write updates every view, 10k-row benchmark | `docs/core/concepts/normalization.md` | | `memocache` (pre-rendered by @ntucker, see below) | Explainer: same data keeps the same object, WeakDependencyMap keys, a write misses its rows, vs normalizr | `docs/core/concepts/performance.md` |