docs(query-core): add JSDoc for shared option and registry types - #11552
Conversation
|
Important Review skippedToo many files! This PR contains 665 files, which is 365 over the limit of 300. To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Repository: TanStack/query/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (665)
You can disable this status message by setting the 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. Comment |
|
View your CI Pipeline Execution ↗ for commit a68c11f
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview1 package(s) bumped directly, 24 bumped as dependents. 🟩 Patch bumps
|
size-limit report 📦
|
🎯 Changes
Ten shared types in
query-corehad no JSDoc, so their generated reference pages rendered with no description at all — and because every adapter re-exportsquery-core, each gap was duplicated across all 7 framework docs.This adds a summary to each of them in
packages/query-core/src/types.ts:RegisterDefaultErrorError; overridden withdefaultErrorQueryKey/MutationKeyReadonlyArray<unknown>; overridden withqueryKey/mutationKeyQueryMeta/MutationMetaRecord<string, unknown>; wheremetacan be read back fromInfiniteDatapagesandpageParamsare index-alignedMutationScopeidruns in serial, waiting inisPaused: true; unscoped mutations run in parallelCancelOptionsCancelledErrorthe cancelled fetch rejects withSetDataOptionsupdatedAtoverrides the timestamp staleness is measured fromEach description was written against the implementation rather than restated from the type signature:
MutationScopematchesMutationCache.canRun()/runNext()and the existing Mutation Scopes guide, including theisPaused: truewait state.InfiniteDataalignment followsinfiniteQueryBehavior.ts, which appends topagesandpageParamstogether.QueryMeta/MutationMetareachability was checked on all three paths:queryFn(Query#fetchbuilds the context withmeta),mutationFn(MutationFunctionContext), and cache-level callbacks (MutationCacheConfigreceives the context;QueryCacheConfigreceives the query, whosemetagetter is public).SetDataOptionsfollowsdataUpdatedAt ?? Date.now()in the success dispatch.CancelOptionsreuses the wording already onCancelledError.Some of these pages render their signature as
type MutationScope = object, so the prose is the only description the page carries.The
Registerexample uses@tanstack/react-query, with the surrounding text listing every adapter module by name —@tanstack/angular-query-experimentalin particular isn't guessable. Augmenting@tanstack/query-corealso works and covers every adapter at once; both forms were verified to type-check.Generated docs
Regenerating with
pnpm run generate-docstouches 664 files, but only 70 are content changes — the pages that gained a description. The other 594 areDefined in:line-number shifts caused by the 57 added source lines.Pages rendering with no description at all: 224 → 154.
✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact