Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/devtools-date-format-perf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@data-client/core': patch
'@data-client/react': patch
'@data-client/vue': patch
---

Fix slow updates in development while Redux DevTools is open

With the [Redux DevTools](https://dataclient.io/docs/getting-started/debugging) extension open, every store update
stalled the page while DevTools serialized the store: about 20ms with 50 entities, and 200ms with 500. Apps doing
many `controller.set()` calls, polling, or live updates would stutter in development. Each update now serializes
40-60x faster, and timestamps still show as readable times like `10:42:07.123 AM`.
19 changes: 11 additions & 8 deletions packages/core/src/manager/DevtoolsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ if (process.env.NODE_ENV !== 'production') {
return serial;
}

const HASINTL = typeof Intl !== 'undefined';
const dateFormat =
typeof Intl !== 'undefined' ?
new Intl.DateTimeFormat('en-US', {
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
fractionalSecondDigits: 3,
})
: undefined;
DEFAULT_CONFIG = {
name: `Data Client: ${globalThis.document?.title}`,
autoPause: true,
Expand All @@ -59,20 +67,15 @@ if (process.env.NODE_ENV !== 'production') {
options: undefined,
/* istanbul ignore next */
replacer:
HASINTL ?
dateFormat ?
(key: string | number | symbol, value: unknown) => {
if (
typeof value === 'number' &&
typeof key === 'string' &&
isFinite(value) &&
(key === 'date' || key.endsWith('At'))
) {
return Intl.DateTimeFormat('en-US', {
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
fractionalSecondDigits: 3,
}).format(value);
return dateFormat.format(value);
}
return value;
}
Expand Down
20 changes: 20 additions & 0 deletions website/blog/2026-10-03-v0.19-batch-set.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ endpoint code about 2x faster, and fixes a round of TypeScript and Vue issues.
- [Entity](/rest/api/Entity) classes can be used where an `EntityInterface` is expected ([#4149](https://github.com/reactive/data-client/pull/4149)); [prepare `pk()` overrides](/blog/2026/10/03/v0.19-batch-set#entity-pk-args) for a future release
- [useCache()](/docs/api/useCache) and [useDLE()](/docs/api/useDLE) return `undefined` for a deleted entity whose refetch failed, instead of a truthy `Symbol` that slipped past `if (!data)` checks; [remove any workarounds](/blog/2026/10/03/v0.19-batch-set#deleted-entity-undefined) ([#4150](https://github.com/reactive/data-client/pull/4150))
- Vue [useFetch()](/vue/api/useFetch) keeps its data from being garbage collected while mounted, like [useSuspense()](/vue/api/useSuspense), so a configured `gcPolicy` no longer evicts prefetched data that components read later ([#4152](https://github.com/reactive/data-client/pull/4152))
- Apps with [Redux DevTools](/docs/getting-started/debugging) open no longer stutter in development on large stores or frequent updates; each update [serializes 40-60x faster](/blog/2026/10/03/v0.19-batch-set#devtools-perf) ([#4163](https://github.com/reactive/data-client/pull/4163))
- Vue [useFetch()](/vue/api/useFetch) is typed as the read-only `Ref` it returns, so `promise.resolved` (always `undefined`) is now a TypeScript error; read `promise.value.resolved` instead ([#4114](https://github.com/reactive/data-client/pull/4114))

**[Breaking Changes:](/blog/2026/10/03/v0.19-batch-set#migration-guide)**
Expand Down Expand Up @@ -492,6 +493,25 @@ function TodoDetail({ id }: { id: number }) {
To show something specific when the refetch failed (for example a 404 after deletion), read `error` from
[useDLE()](/docs/api/useDLE) rather than inspecting `data`.

### Faster Redux DevTools {#devtools-perf}

With the [Redux DevTools](/docs/getting-started/debugging) extension open, every store update in development
serializes the whole store for the extension, and each timestamp in it was formatted the slow way. Large stores or
frequent updates, like polling, live data or many `controller.set()` calls, made the page stutter. Each update now
serializes **40-60x faster**, and timestamps still read like `10:42:07.123 AM`
([#4163](https://github.com/reactive/data-client/pull/4163)). Production builds don't include DevTools, so they are
unaffected.

<PerfChart
title="DevTools serialization per store update"
baselineLabel="v0.18"
valueLabel="v0.19"
rows={[
{ label: '50 entities', baseline: 18.6, value: 0.31 },
{ label: '500 entities', baseline: 201, value: 5.0 },
]}
/>

## Migration guide

import PkgTabs from '@site/src/components/PkgTabs';
Expand Down
Loading