Skip to content

feat(query-core): export cache config types - #11263

Merged
TkDodo merged 3 commits into
TanStack:mainfrom
spaansba:mutation-and-query-cache-config-type-export
Aug 23, 2026
Merged

feat(query-core): export cache config types#11263
TkDodo merged 3 commits into
TanStack:mainfrom
spaansba:mutation-and-query-cache-config-type-export

Conversation

@spaansba

@spaansba spaansba commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

🎯 Changes

Exports MutationCacheConfig and QueryCacheConfig so wrapper packages can type and extend cache configurations directly. Currently, wrapper packages must derive these types from constructor params:

type MutationCacheConfig = NonNullable<
  ConstructorParameters<typeof MutationCache>[0]
>

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • New Features

    • Added public access to query and mutation cache configuration types.
    • Developers can now import these types directly when configuring cache behavior.
  • Chores

    • Prepared a patch release documenting the newly available exports.

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c11f8b13-a7e0-40b6-9166-604377a9b310

📥 Commits

Reviewing files that changed from the base of the PR and between bc423b3 and e261061.

📒 Files selected for processing (4)
  • .changeset/clean-caches-export.md
  • packages/query-core/src/index.ts
  • packages/query-core/src/mutationCache.ts
  • packages/query-core/src/queryCache.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The change makes MutationCacheConfig and QueryCacheConfig public exports from @tanstack/query-core. A Changeset records a patch release for these exports.

Changes

Cache configuration exports

Layer / File(s) Summary
Export cache configuration interfaces
packages/query-core/src/mutationCache.ts, packages/query-core/src/queryCache.ts, packages/query-core/src/index.ts, .changeset/clean-caches-export.md
The two configuration interfaces are exported from their modules and from the package index. The Changeset records a patch release.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to e2610

This localized type-export change does not introduce an actionable merge-blocking risk and is merge-ready after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the export of cache configuration types from query-core.
Description check ✅ Passed The description includes all required sections, explains the change and motivation, and confirms testing and changeset creation.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Aug 23, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 8a04b22

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 7m 26s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 48s View ↗

☁️ Nx Cloud last updated this comment at 2026-08-23 17:43:17 UTC

@pkg-pr-new

pkg-pr-new Bot commented Aug 23, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@11263

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@11263

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@11263

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@11263

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@11263

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@11263

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@11263

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@11263

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@11263

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@11263

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@11263

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@11263

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@11263

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@11263

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@11263

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@11263

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@11263

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@11263

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@11263

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@11263

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@11263

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@11263

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@11263

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@11263

commit: 8a04b22

@TkDodo
TkDodo merged commit 80fbf73 into TanStack:main Aug 23, 2026
9 checks passed
@github-actions github-actions Bot mentioned this pull request Aug 23, 2026
@spaansba
spaansba deleted the mutation-and-query-cache-config-type-export branch August 23, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants