v0.16: Parallel Fetching, Collection.move, Lazy
· 12 min read
New Features:
- Parallel data loading with useFetch() - Fetch multiple endpoints concurrently with
use(useFetch()), avoiding sequential waterfalls - Collection.move - Move entities between Collections with a single operation
- Collection.moveWith() - Customize move behavior (e.g., prepend instead of append)
- Lazy - Deferred relationship denormalization for performance and memoization isolation
Other Improvements:
- Direct schema imports - Import schema classes directly without the
schemanamespace - Denormalization depth limit - Prevent stack overflow in large bidirectional entity graphs; configurable via
Entity.maxEntityDepth(#3822) - DevToolsManager exposes
globalThis.__DC_CONTROLLERS__in dev mode for programmatic store access from Chrome DevTools MCP and Expo MCP. Use the data-client-react skill to enable AI-assisted debugging. - Remove misleading 'Uncaught Suspense' warning during Next.js SSR
- Fix
sideEffect: falsetype being lost withmethod: 'POST'in RestEndpoint - renderDataHook() automatic cleanup after each test — no manual
cleanup()calls needed - renderDataHook() returns per-render
cleanup()andallSettled()for reliable test teardown
Collection.move makes it easy to move entities between Collections with a single operation:
TaskResource
TaskCard
TaskBoard
import { useController } from '@data-client/react'; import { TaskResource, type Task } from './TaskResource'; export default function TaskCard({ task }: { task: Task }) { const handleMove = () => ctrl.fetch( TaskResource.getList.move, { id: task.id }, { id: task.id, status: task.status === 'backlog' ? 'in-progress' : 'backlog' }, ); const ctrl = useController(); return ( <div className="listItem"> <span style={{ flex: 1 }}>{task.title}</span> <button onClick={handleMove}> {task.status === 'backlog' ? '\u25bc' : '\u25b2'} </button> </div> ); }
🔴 Live Preview
Store▶
- path-to-regexp v8 - RestEndpoint.path syntax updated:
/:optional?→{/:optional},/:repeat+→/*repeat(typed asstring[]) - useFetch() returns UsablePromise - Returns a thenable for
React.use(); check.resolvedinstead of truthiness
Upgrade with an automated codemod for all breaking changes:
npx jscodeshift -t https://dataclient.io/codemods/v0.16.js --extensions=ts,tsx,js,jsx src/
