* test(query-core/mutationCache): add test for removing a mutation that does not exist in the cache
* ci: apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* test({react,preact}-query/infiniteQueryOptions): replace type annotation with 'as const'
* Revert "test({react,preact}-query/infiniteQueryOptions): replace type annotation with 'as const'"
This reverts commit 2bb0029621.
* test({solid,svelte}-query/mutationOptions): replace 'toStrictEqual' with 'toBe' for identity check
* test(svelte-query/createQuery): fix 'it.todo' for different stale times by advancing timer before query creation
* ci: apply automated fixes
* test(svelte-query/createQuery): reduce 'advanceTimersByTimeAsync' from 11 to 10 to match 'staleTime: 10'
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* test(svelte-query/createQuery): switch to fake timers, replace 'vi.waitFor' with 'vi.advanceTimersByTimeAsync', and move 'queryClient' to 'beforeEach'
* test(svelte-query/createQuery): use 'QueryCache' type instead of 'ReturnType' for 'queryCache'
* ci: apply automated fixes
* test(svelte-query/createQuery): reduce 'advanceTimersByTimeAsync' from 100 to 11 for staleTime test
* test(svelte-query/createQuery): fix 'advanceTimersByTimeAsync' to 101 to match 'staleTime: 100'
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
tests: use proxy instead of query core
infiniteQueryOptions.test-d.ts for Vue Query was incorrectly using the
bare query client from core instead of the vue proxy query client.
Co-authored-by: Wonsuk Choi <sukvvon@gmail.com>
* test(svelte-query/createQueries): add test for not fetching when 'isRestoring' is true
* test(svelte-query/createQueries): remove '(isRestoring)' from describe block
* test(svelte-query/createQueries): move 'queryClient' inside 'IsRestoringExample' component
* fix(eslint-plugin): normalize whitespace in allowList variable matching
When a member expression spans multiple lines (e.g. `ignored\n .run()`),
`sourceCode.getText()` preserves the newline. The root segment extracted
by splitting on `.'` then becomes `'ignored\n '`, which never matches
the allowlisted variable name `'ignored'`.
Fix: extend `normalizeChain` to also collapse all whitespace, so
multi-line chains produce the same identifier path as single-line ones.
Fixes#10334
* changeset
---------
Co-authored-by: Maks Pikov <mixelburg@users.noreply.github.com>
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>
* docs(react): add polling guide
Adds a dedicated guide for refetchInterval-based polling. The option was
only mentioned in passing in important-defaults.md with no explanation of
how it works, how to adapt it dynamically, or how it interacts with window
focus, networkMode, and the enabled flag.
Covers:
- Basic setup and independence from staleTime
- Dynamic intervals via function form
- refetchIntervalInBackground for dashboards / always-on UIs
- Disabling window-focus refetching for fullscreen game and kiosk UIs
- Pausing polling with the enabled flag
- networkMode: 'always' for unreliable navigator.onLine environments
- Deduplication behavior across multiple observers
Updates config.json to add the guide to the React sidebar between
Window Focus Refetching and Disabling/Pausing Queries.
Adds a cross-reference in important-defaults.md.
* docs(react/polling): add example markers for framework portability
* docs(react): fix deduplication note — timers are per observer, not per query
* docs(react): address review feedback on polling guide
- Remove staleTime enumeration; link to Important Defaults instead
- Remove game/kiosk focus management examples (scope creep)
- Rewrite pausing polling to use refetchInterval function instead of enabled: false
- Fix offline support section: connectivity uses online/offline events, not navigator.onLine
- Fix deduplication note: remove queuing implication and em dash
- Add non-browser environments note pointing to React Native guide
* docs(solid,vue): add polling guide framework ports
* docs: wrap React Native section in markers for framework port exclusion
* ci: apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* 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>
* docs(react): clarify staleTime 'static' vs Infinity with 'always' triggers
* docs(react): lead with invalidateQueries() distinction for staleTime: 'static' vs Infinity
* test({react,preact}-query): move 'queryClient' and 'queryCache' to 'beforeEach' for per-test isolation
* test(solid-query): move 'queryClient' and 'queryCache' to 'beforeEach' for per-test isolation
* test({react,preact}-query): add 'queryClient.clear()' to 'afterEach' in 'useQuery' and 'useMutation'
* test({react,preact}-query): add 'queryClient.clear()' to 'afterEach' in 'ssr' and 'suspense'
* test({react,preact}-query/ssr): remove redundant 'queryCache.clear()' calls in individual tests
* ci: apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* test({react,preact}-query/useSuspenseQueries): inline test helpers, remove shared 'queryClient', and use 'beforeEach'/'afterEach' for setup and teardown
* ci: apply automated fixes
* test({react,preact}-query/useSuspenseQueries): replace '[1] as const' with 'queryKey()' util and fix 'act' callback type in preact-query
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>