Skip to content
Source
Sign inSign up
TanStack/query

refactor(react-query): simplify the Suspense promise cache #12682

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

TkDodocommented

🎯 Changes

Both React Suspense callers request a fetch. Remove the unused cache lookup mode and share the error reset logic for new and reused promises. The tests cover reuse during a fetch and a new promise after settlement.

With pnpm test:size, React full drops from 12,647 B to 12,608 B. React minimal stays at 8,334 B. Both pass their Brotli size limits.

✅ 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.

🚀 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: 9314e4f22a11a71a8baf467d29f17c76d5fa7474

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

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

      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 9314e4f22a11a71a8baf467d29f17c76d5fa7474

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

      ☁️ Nx Cloud last updated this comment at 2026-11-23 10:39:11 UTC

    5. More templates

      @tanstack/angular-query

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

      @tanstack/angular-query-devtools

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

      @tanstack/angular-query-persist-client

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

      @tanstack/eslint-plugin-query

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

      @tanstack/lit-query

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

      @tanstack/preact-query

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

      @tanstack/preact-query-devtools

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

      @tanstack/preact-query-persist-client

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

      @tanstack/query-async-storage-persister

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

      @tanstack/query-broadcast-client-experimental

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

      @tanstack/query-core

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

      @tanstack/query-devtools

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

      @tanstack/query-persist-client-core

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

      @tanstack/react-query

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

      @tanstack/react-query-devtools

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

      @tanstack/react-query-next-experimental

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

      @tanstack/react-query-persist-client

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

      @tanstack/solid-query

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

      @tanstack/solid-query-devtools

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

      @tanstack/solid-query-persist-client

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

      @tanstack/svelte-query

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

      @tanstack/svelte-query-devtools

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

      @tanstack/svelte-query-persist-client

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

      @tanstack/vue-query

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

      @tanstack/vue-query-devtools

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

      commit: 9314e4f

    6. size-limit report 📦

      PathSize
      react full12.31 KB (-0.31% 🔽)
      react minimal8.14 KB (0%)
    7. TkDodo merged this69a101f

    8. TkDodo closed this

Sign in to join this conversation.