0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
Commit graph

412 commits

Author SHA1 Message Date
github-actions[bot]
51f12db919
ci: Version Packages (#11294)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-25 23:24:07 +02:00
github-actions[bot]
730b3aa06c
ci: Version Packages (#11276) 2026-08-25 04:21:47 +09:00
github-actions[bot]
388bbaf181
ci: Version Packages (#11265)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-23 19:57:36 +02:00
github-actions[bot]
bc423b37ef
ci: Version Packages (#11261)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-23 12:57:01 +02:00
github-actions[bot]
5743468462
ci: Version Packages (#11206)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-22 20:52:42 +02:00
Wonsuk Choi
c9dba0736c
test(query-broadcast-client-experimental): replace inline query key literals with 'queryKey' in incoming message tests (#11247) 2026-08-22 10:48:36 +09:00
한국
6796c51275
fix(broadcast-client): recover from errors thrown while applying an incoming cross-tab message (#11242)
* fix(broadcast-client): recover from errors thrown while applying an incoming cross-tab message

If applying an incoming cross-tab message (query.setState/queryCache.build,
which notifies observers) throws, the internal `tx()` helper's `transaction`
flag was never reset. This silently disabled all future outgoing broadcasts
from this tab for the rest of the session. Guard with try/finally so a single
failed message can't permanently break cross-tab sync.

* test(broadcast-client): also cover the query.setState throw path

The existing regression test only exercised queryCache.build (a brand-new
remote query hash). Add a case where the incoming message targets an
existing query, so an exception during query.setState is exercised too.

Addresses CodeRabbit review feedback on #11242.
2026-08-21 11:50:13 +02:00
Wonsuk Choi
2fbe04e492
test(query-broadcast-client-experimental): replace inline 'new Promise' timeouts with 'sleep' from 'query-test-utils' (#11241) 2026-08-21 13:56:29 +09:00
Wonsuk Choi
bec1f1b286
test(query-broadcast-client-experimental): replace inline query key literals with 'queryKey' from 'query-test-utils' (#11240) 2026-08-21 13:47:08 +09:00
n-satoshi061
3c79861ab1
fix(broadcast-client): handle unhandled postMessage rejections (#10771)
* fix(broadcast-client): handle unhandled postMessage rejections

Wrap channel.postMessage() calls in safePost() to catch DataCloneError
and similar failures that occur when query data contains non-cloneable
values (ReadableStream, Response, Vue reactive proxies, etc.).

Adds an optional onBroadcastError callback to BroadcastQueryClientOptions
so consumers can pipe errors to Sentry/Datadog. Falls back to console.warn
in development when the callback is not provided.

Fixes #10543

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(broadcast-client): guard against throwing onBroadcastError callback

Wrap onBroadcastError() in a try/catch so that if the callback itself
throws, the error does not escape as an unhandled rejection. Falls back
to console.warn in development when the callback throws.

Add a test asserting no unhandledRejection fires when onBroadcastError throws.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(broadcast-client): handle async onBroadcastError rejections

Support async onBroadcastError callbacks by calling .catch() on the
returned Promise, preventing unhandled rejections when the callback
rejects asynchronously.

Also extracts the console.warn fallback into warnBroadcastError to
deduplicate the warning logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test(broadcast-client): use try/finally to ensure unhandledRejection listener cleanup

Prevents listener leaks into subsequent tests if an assertion throws
before process.off() is reached.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor(broadcast-client): improve types, messages, and docs

- Export BroadcastErrorEvent interface with QueryKey typing so consumers
  can import the type directly
- Use discriminated union for internal BroadcastMessage (state only on
  updated) for more precise typing
- onBroadcastError now receives BroadcastErrorEvent (no internal state
  field) instead of the raw BroadcastMessage
- Differentiate dev warning messages: broadcast failures explain the
  structured-clone cause and consequence; onBroadcastError failures
  explicitly identify the hook as the source
- Remove warnBroadcastError helper in favour of context-specific inlined
  warn calls
- Fix duplicate queryClient.getQueryCache() call (use queryCache directly)
- Add JSDoc to all BroadcastQueryClientOptions fields
- Add onBroadcastError section to broadcastQueryClient docs with Sentry
  example

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test(broadcast-client): assert warn message when onBroadcastError throws or rejects

Add two tests that verify the '[broadcastQueryClient] onBroadcastError
threw while handling...' console.warn message is emitted in development
when the onBroadcastError callback itself throws synchronously or rejects
asynchronously.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(broadcast-client): include state in 'added' broadcasts

The receiver's onmessage handler reads state for 'added' events to call
query.setState(state) and queryCache.build(..., state), but the sender
was not including state in the outbound message. This caused receiving
tabs to apply undefined state for newly added queries.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test(broadcast-client): wrap warnSpy in try/finally to prevent spy leakage

If an assertion fails before mockRestore(), the console.warn spy would
leak into subsequent tests. Wrapping each spy block in try/finally
ensures restore always runs regardless of test outcome.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ci: apply automated fixes

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-20 10:24:33 +02:00
Dominik Dorfmeister 🔮
267154cf6b
chore: tsup -> tsdown (#11222)
* chore: tsup -> tsdown

* revert size-limit and fix the build instead

* fix angular and devtools build

* fix nextJs builds

* more solid related things

* fix: import order
2026-08-18 15:19:43 +02:00
Dominik Dorfmeister 🔮
279bb5508b
chore: update to ts 7 and move cut-off to 5.6 (#11212)
* update to ts 7 and move cut-off to 5.7

* changeset

* fix: use typescript v6 with tsup

* ci: apply automated fixes

* ref: update sveltejs/package

* ref: make ts6 the default typescript

* fix: lit build

* effing tsup

* move ignoreDeprecations to solid tsup config

* move ignoreDeprecations to relevant tsup configs

* better lit fix

* restore vue queryClient

* Revert "restore vue queryClient"

This reverts commit 4f95fc918a.

* fix things

* ignore devDep ordering

* vue needs to use ts6

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-17 22:50:18 +02:00
github-actions[bot]
86bb8a6fb2
ci: Version Packages (#11094)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-21 15:00:30 +02:00
github-actions[bot]
181ea826cb
ci: Version Packages (#11089)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-20 14:01:04 +02:00
github-actions[bot]
610e8d1684
ci: Version Packages (#10996)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-27 22:28:10 +02:00
github-actions[bot]
b80929716f
ci: Version Packages (#10977)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-23 11:57:22 +02:00
github-actions[bot]
f3d8d2abbf
ci: Version Packages (#10774)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-02 21:21:24 +02:00
Raashish Aggarwal
532bb298fb
fix(tests): disable local coverage instrumentation (#10776)
Disable local coverage instrumentation

Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-05-26 17:29:33 +02:00
github-actions[bot]
ba6e7beebd
ci: Version Packages (#10767)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-23 19:13:22 +02:00
github-actions[bot]
05cf2bc0a4
ci: Version Packages (#10758)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-22 21:16:14 +02:00
github-actions[bot]
5ff4f6936b
ci: Version Packages (#10755)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-22 20:50:43 +02:00
github-actions[bot]
3e85350749
ci: Version Packages (#10706)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-18 21:44:23 +02:00
github-actions[bot]
9d2692cec4
ci: Version Packages (#10695)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-11 16:08:01 +02:00
Wonsuk Choi
74fa05eb1b
chore(tsconfig.json): narrow 'include' pattern to prevent TS6053 race conditions from tsup bundled config files (#10522)
* chore(tsconfig.json): exclude tsup bundled config files to prevent TS6053 race conditions

* chore(tsconfig.json): narrow 'include' pattern to specific config extensions

* ci: apply automated fixes

* chore(tsconfig.json): replace brace expansion with explicit '*.config.ts' and '*.config.js' patterns

* chore(tsconfig.json): use single-line 'include' arrays for consistency

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-05-04 03:24:13 +09:00
github-actions[bot]
8c3d523d0a
ci: Version Packages (#10630)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-03 16:45:38 +02:00
github-actions[bot]
9800c8f1a3
ci: Version Packages (#10623)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-02 13:08:18 +09:00
github-actions[bot]
3ae42619e5
ci: Version Packages (#10620)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-01 16:42:23 +09:00
github-actions[bot]
87f7ccf580
ci: Version Packages (#10604)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-29 01:36:20 +09:00
github-actions[bot]
441204b9d2
ci: Version Packages (#10582)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-25 19:25:49 +02:00
github-actions[bot]
55afb3e6fb
ci: Version Packages (#10581)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-25 17:51:28 +02:00
github-actions[bot]
fe287cc247
ci: Version Packages (#10579)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-25 13:15:56 +02:00
github-actions[bot]
93b2845000
ci: Version Packages (#10575)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-25 11:40:41 +02:00
github-actions[bot]
2f9527ed76
ci: Version Packages (#10568)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-23 16:20:54 +02:00
github-actions[bot]
ad517e5564
ci: Version Packages (#10567)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-23 15:15:00 +02:00
github-actions[bot]
a3ec7b30cc
ci: Version Packages (#10520)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-19 12:55:14 +02:00
github-actions[bot]
69d2757c98
ci: Version Packages (#10514)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-18 20:07:19 +02:00
github-actions[bot]
adc2543ade
ci: Version Packages (#10454)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-11 19:54:13 +02:00
github-actions[bot]
6040278e75
ci: Version Packages (#10451)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-11 18:06:24 +02:00
github-actions[bot]
125067c05a
ci: Version Packages (#10436)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-09 10:33:54 +02:00
github-actions[bot]
5ca721fb05
ci: Version Packages (#10379)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-03 12:20:46 +02:00
github-actions[bot]
75052a7fd0
ci: Version Packages (#10370)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-01 09:58:40 +02:00
Marc-André Côté
4a3275c15e
fix(build): exclude config files from production DTS rollup (#10358)
* fix(build): exclude config files from production DTS rollup

The `experimentalDts` option in tsup respects the tsconfig `include`
array to determine which files are in scope for DTS generation. Each
package's `tsconfig.json` includes `*.config.*` for IDE support, and
`tsconfig.prod.json` inherited this without overriding it. This caused
`vite.config.ts` and `tsup.config.ts` to be swept into the DTS rollup,
leaking `import { UserConfig } from 'vite'` into published types. Since
vite references `@types/node`, this globally overrides the DOM
`setTimeout` return type from `number` to `NodeJS.Timeout` for all
consumers.

Add `"include": ["src"]` (and `"exclude": ["src/__tests__"]` where
applicable) to all `tsconfig.prod.json` files that were missing it,
matching the pattern already used by query-core, react-query,
preact-query, and solid-query.

* chore: add changeset for DTS type pollution fix

* test(build): add regression test for build tool type leaks in .d.ts files

Adds scripts/verify-dts-imports.ts that scans all published .d.ts files
for forbidden imports from build tools (vite, tsup, vitest) and
`/// <reference types="node" />`. Wired into test:pr and test:ci to
run after the build completes.

* fix(build): fail fast when no .d.ts files found in verify-dts-imports

* chore: add exclude for consistency in react-query-next-experimental

* chore: fix log message to mention both .d.ts and .d.cts files

* ci: apply automated fixes

* chore: remove verify-dts-imports script and related package.json changes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-04-01 09:40:46 +02:00
github-actions[bot]
73e783bd86
ci: Version Packages (#10364)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-31 12:42:54 +02:00
github-actions[bot]
1047cdc393
ci: Version Packages (#10326)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-23 16:31:44 +01:00
github-actions[bot]
5806444b97
ci: Version Packages (#10324)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-23 15:21:38 +01:00
github-actions[bot]
4d7de830eb
ci: Version Packages (#10317)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-22 18:40:14 +01:00
github-actions[bot]
8fe71e4fe7
ci: Version Packages (#10313)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-22 00:57:17 +09:00
github-actions[bot]
c613c22535
ci: Version Packages (#10309)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-21 23:35:14 +09:00
github-actions[bot]
b6fd86b0b0
ci: Version Packages (#10297)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-19 11:09:07 +01:00
github-actions[bot]
79e37cb5de
ci: Version Packages (#10296)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
2026-03-19 11:04:55 +01:00