Skip to content

docs(query-core): add JSDoc for Subscribable and Removable base classes 🤖🤖🤖 - #11467

Open
pengzh1 wants to merge 1 commit into
TanStack:mainfrom
pengzh1:docs/jsdoc-manager-family
Open

docs(query-core): add JSDoc for Subscribable and Removable base classes 🤖🤖🤖#11467
pengzh1 wants to merge 1 commit into
TanStack:mainfrom
pengzh1:docs/jsdoc-manager-family

Conversation

@pengzh1

@pengzh1 pengzh1 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

🎯 Changes

Follow-up to #11438, which added JSDoc across packages/query-core/src but left the two internal base classes untouched: subscribable.ts and removable.ts had no JSDoc at all.

  • Subscribable (extended by QueryCache, MutationCache, QueryObserver, MutationObserver, QueriesObserver, FocusManager, and OnlineManager): documents the class, subscribe (that it returns an unsubscribe function and is bound to the instance, with an example), hasListeners, and the onSubscribe/onUnsubscribe lifecycle hooks.
  • Removable (extended by Query and Mutation): documents the class, the gcTime field, destroy, scheduleGc, updateGcTime (the 5 minutes / Infinity on the server default, and that it only ever raises gcTime), clearGcTimeout, and the abstract optionalRemove.

Since subscribe, hasListeners, and destroy are inherited by the public classes above, these docs now show up on hover for e.g. queryCache.subscribe(...), which previously had none. Wording follows the style used in #11438.

JSDoc-only change: no runtime code is modified (74 added lines, 0 removed).

Verified locally in packages/query-core: tsc --build (no new errors), vitest (27 files / 680 tests passing), and prettier --check.

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

Summary by CodeRabbit

  • Documentation
    • Added API documentation for lifecycle and subscription management classes and their public methods.
    • Clarified behaviors related to garbage-collection scheduling, listener management, and subscription lifecycles.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: f225cee7-cb25-4a00-a7c7-a17953cebf30

📥 Commits

Reviewing files that changed from the base of the PR and between 7452ef6 and 3424aef.

📒 Files selected for processing (2)
  • packages/query-core/src/removable.ts
  • packages/query-core/src/subscribable.ts

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


📝 Walkthrough

Walkthrough

This change adds JSDoc comments to the Removable and Subscribable classes in query-core. It does not change declarations, logic, control flow, or error handling.

Changes

Query core API documentation

Layer / File(s) Summary
Removable lifecycle documentation
packages/query-core/src/removable.ts
Documents garbage-collection timing, timeout handling, destruction, and optional removal.
Subscribable lifecycle documentation
packages/query-core/src/subscribable.ts
Documents subscription behavior, listener checks, and lifecycle hooks.

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

Suggested reviewers: tkdodo

Merge Risk: ⚪ Minimal · up to 3424a

This PR adds JSDoc for existing subscription and garbage-collection lifecycle APIs without changing runtime behavior, so it is ready to merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the documentation change and names both affected base classes. The emojis are unnecessary but do not obscure the purpose.
Description check ✅ Passed The description follows the required template, explains the changes and motivation, documents validation performed, completes the checklist, and identifies the change as documentation-only with no rel…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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.

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.

1 participant