Skip to content
Source
Sign inSign up
TanStack/store

fix(store): release dormant computed dependencies without reconnecting graphs #376

OpenSheraff(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/376/headopened

Computed atoms currently stay reachable through source subscriptions after an unobserved read, so sources can retain unused derived graphs indefinitely. Keep dormant forward dependencies without reverse subscriptions, validate cached dependency revisions, and reconnect only for real observation. Reuse attached links through a small observed-read path while preserving snapshot identity, custom equality, and captured getters.

Fixes #372. This is an alternative to #373 and does not modify that PR.

Prior validation passed 254 runtime tests (1 skipped), an 80,000-step graph oracle, four TypeScript versions, build, lint, and package checks. No new checks were run for publishing, as requested.

Measured against current main: observed chains at depths 8/32 are 3.9%/2.8% slower and diamond updates 5.3% slower. Dormant depth-128 validation is about 40× faster than #373. Unchanged subscription churn is 23.7% faster than main; changed subscription churn is 16.1% slower. The createAtom gzip bundle is 1,924 bytes versus main's 1,504 and #373's 1,754; size optimization remains a follow-up.

See reproducible hot-path measurements for the methodology, raw results, and tradeoffs.

    1. changeset-bot[bot](GitHub profile, opens in a new tab)commented

      🦋 Changeset detected

      Latest commit: 5164d67f07d910f5145c5a36f3befd0e24186b34

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

      This PR includes changesets to release 9 packages
      NameType
      @tanstack/storePatch
      @tanstack/angular-storePatch
      @tanstack/lit-storePatch
      @tanstack/octane-storePatch
      @tanstack/preact-storePatch
      @tanstack/react-storePatch
      @tanstack/solid-storePatch
      @tanstack/svelte-storePatch
      @tanstack/vue-storePatch

      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. nx-cloud[bot](GitHub profile, opens in a new tab)commented

      View your CI Pipeline Execution ↗ for commit 5164d67f07d910f5145c5a36f3befd0e24186b34

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

      ☁️ Nx Cloud last updated this comment at 2026-10-03 11:14:21 UTC

    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

      Important

      Draft PR not reviewed

      Draft PRs are not automatically reviewed by default.

      • Trigger a manual review

      To automatically review draft PRs, update your CodeRabbit configuration:

      reviews:
        auto_review:
          drafts: true
      ✨ Finishing Touches 💡 1
      🛠️ Fix failing CI checks 💡
      • Commit to this branch
      • Create a new PR
      🧪 Generate unit tests (beta)
      • Create a new PR
      • Autopilot · 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
      Comment `@coderabbitai help` to get the list of available commands.
    4. pkg-pr-new[bot](GitHub profile, opens in a new tab)commented
      @tanstack/angular-store

      npm i https://pkg.pr.new/@tanstack/angular-store@376

      @tanstack/lit-store

      npm i https://pkg.pr.new/@tanstack/lit-store@376

      @tanstack/octane-store

      npm i https://pkg.pr.new/@tanstack/octane-store@376

      @tanstack/preact-store

      npm i https://pkg.pr.new/@tanstack/preact-store@376

      @tanstack/react-store

      npm i https://pkg.pr.new/@tanstack/react-store@376

      @tanstack/solid-store

      npm i https://pkg.pr.new/@tanstack/solid-store@376

      @tanstack/store

      npm i https://pkg.pr.new/@tanstack/store@376

      @tanstack/svelte-store

      npm i https://pkg.pr.new/@tanstack/svelte-store@376

      @tanstack/vue-store

      npm i https://pkg.pr.new/@tanstack/vue-store@376

      commit: 5164d67

Sign in to join this conversation.