Skip to content
Source
Sign inSign up
TanStack/query

refactor(query-core): simplify mutation scope lookup #12686

MergedTkDodomerged 1 commit intoquery-v6 fromrefs/pull/12686/headmerged by TkDodo View on GitHub

TkDodocommented

🎯 Changes

Simplify how the mutation cache finds the next mutation and removes entries from a scope. Keep the per-scope queues and their execution order.

pnpm test:size reports 12,670 B for React full (−24 B) and 8,382 B for React minimal (−14 B).

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I have followed the AI contribution policy and fully understand the code in this pull request, including any code generated with AI assistance.

Builds, tests, type checks, and lint passed locally for Query Core, React Query, and Preact Query.

🚀 Release Impact

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

      Latest commit: d726d788a3429adae4b14319e6dcb370bda94831

      The changes in this PR will be included in the next version bump.

      This PR includes changesets to release 25 packages
      NameType
      @tanstack/query-corePatch
      @tanstack/angular-queryPatch
      @tanstack/lit-queryPatch
      @tanstack/preact-queryPatch
      @tanstack/query-async-storage-persisterPatch
      @tanstack/query-broadcast-client-experimentalPatch
      @tanstack/query-devtoolsPatch
      @tanstack/query-persist-client-corePatch
      @tanstack/react-queryPatch
      @tanstack/solid-queryPatch
      @tanstack/svelte-queryPatch
      @tanstack/vue-queryPatch
      @tanstack/angular-query-devtoolsPatch
      @tanstack/angular-query-persist-clientPatch
      @tanstack/preact-query-devtoolsPatch
      @tanstack/preact-query-persist-clientPatch
      @tanstack/react-query-devtoolsPatch
      @tanstack/solid-query-devtoolsPatch
      @tanstack/svelte-query-devtoolsPatch
      @tanstack/vue-query-devtoolsPatch
      @tanstack/react-query-persist-clientPatch
      @tanstack/solid-query-persist-clientPatch
      @tanstack/svelte-query-persist-clientPatch
      @tanstack/react-query-next-experimentalPatch
      @tanstack/eslint-plugin-queryPatch

      Not sure what this means? Click here to learn what changesets are.

      Click here if you're a maintainer who wants to add another changeset to this PR

    2. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on base/target branches other than the default branch.

      Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      Run configuration

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • Trigger review
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      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

    3. 🚀 Changeset Version Preview

      23 package(s) bumped directly, 2 bumped as dependents.

      🟥 Major bumps

      PackageVersionReason
      @tanstack/angular-query5.108.3 → 6.0.0Changeset
      @tanstack/angular-query-devtools5.108.3 → 6.0.0Changeset
      @tanstack/eslint-plugin-query5.108.3 → 6.0.0Changeset
      @tanstack/lit-query0.2.43 → 1.0.0Changeset
      @tanstack/preact-query5.108.3 → 6.0.0Changeset
      @tanstack/preact-query-devtools5.108.3 → 6.0.0Changeset
      @tanstack/preact-query-persist-client5.108.3 → 6.0.0Changeset
      @tanstack/query-async-storage-persister5.108.3 → 6.0.0Changeset
      @tanstack/query-broadcast-client-experimental5.108.3 → 6.0.0Changeset
      @tanstack/query-core5.108.3 → 6.0.0Changeset
      @tanstack/query-devtools5.108.3 → 6.0.0Changeset
      @tanstack/query-persist-client-core5.108.3 → 6.0.0Changeset
      @tanstack/react-query5.108.3 → 6.0.0Changeset
      @tanstack/react-query-devtools5.108.3 → 6.0.0Changeset
      @tanstack/react-query-next-experimental5.108.3 → 6.0.0Changeset
      @tanstack/react-query-persist-client5.108.3 → 6.0.0Changeset
      @tanstack/solid-query5.108.3 → 6.0.0Changeset
      @tanstack/solid-query-devtools5.108.3 → 6.0.0Changeset
      @tanstack/solid-query-persist-client5.108.3 → 6.0.0Changeset
      @tanstack/svelte-query6.4.6 → 7.0.0Changeset
      @tanstack/svelte-query-devtools6.4.6 → 7.0.0Changeset
      @tanstack/vue-query5.108.3 → 6.0.0Changeset
      @tanstack/vue-query-devtools6.4.6 → 7.0.0Changeset
      @tanstack/angular-query-persist-client5.108.3 → 6.0.0Dependent
      @tanstack/svelte-query-persist-client6.4.6 → 7.0.0Dependent
    4. nx-cloud[bot](GitHub profile, opens in a new tab)commented

      View your CI Pipeline Execution ↗ for commit d726d788a3429adae4b14319e6dcb370bda94831

      CommandStatusDurationResult
      nx affected --targets=test:sherif,test:knip,tes...✅ Succeeded6m 35sView ↗
      nx run-many --target=build --exclude=examples/*...✅ Succeeded35sView ↗

      ☁️ Nx Cloud last updated this comment at 2026-11-23 12:52:22 UTC

    5. More templates

      @tanstack/angular-query

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

      @tanstack/angular-query-devtools

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

      @tanstack/angular-query-persist-client

      npm i https://pkg.pr.new/@tanstack/angular-query-persist-client@12686

      @tanstack/eslint-plugin-query

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

      @tanstack/lit-query

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

      @tanstack/preact-query

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

      @tanstack/preact-query-devtools

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

      @tanstack/preact-query-persist-client

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

      @tanstack/query-async-storage-persister

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

      @tanstack/query-broadcast-client-experimental

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

      @tanstack/query-core

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

      @tanstack/query-devtools

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

      @tanstack/query-persist-client-core

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

      @tanstack/react-query

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

      @tanstack/react-query-devtools

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

      @tanstack/react-query-next-experimental

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

      @tanstack/react-query-persist-client

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

      @tanstack/solid-query

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

      @tanstack/solid-query-devtools

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

      @tanstack/solid-query-persist-client

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

      @tanstack/svelte-query

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

      @tanstack/svelte-query-devtools

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

      @tanstack/svelte-query-persist-client

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

      @tanstack/vue-query

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

      @tanstack/vue-query-devtools

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

      commit: d726d78

    6. size-limit report 📦

      PathSize
      react full12.37 KB (-0.19% 🔽)
      react minimal8.19 KB (-0.17% 🔽)
    7. TkDodo merged thisd9293be

    8. TkDodo closed this

Sign in to join this conversation.