Skip to content

docs(vue-query): add JSDoc and generate reference docs with TypeDoc - #11378

Draft
sukvvon wants to merge 4 commits into
mainfrom
docs/vue-query-add-jsdoc
Draft

docs(vue-query): add JSDoc and generate reference docs with TypeDoc#11378
sukvvon wants to merge 4 commits into
mainfrom
docs/vue-query-add-jsdoc

Conversation

@sukvvon

@sukvvon sukvvon commented Sep 3, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Adds JSDoc across packages/vue-query/src/ (18 of 19 files — index.ts is export-only), then switches docs/framework/vue/reference/ from 14 hand-written flat files to TypeDoc-generated output (functions/, classes/, type-aliases/, variables/, index.md) — the entry point registered in #11374. docs/config.json's vue framework section is rebuilt to match (14 → 41 entries), following index.md's generation order (Classes → Type Aliases → Variables → Functions, alphabetical within each group), same as react/preact/solid.

vue-query has no react-query source to port JSDoc from for 4 files with no react equivalent (useQueryClient.ts, vueQueryPlugin.ts, queryClient.ts, queryCache.ts/mutationCache.ts, utils.ts) — these were written directly from source, cross-checked against docs/framework/vue/installation.md/quick-start.md for accurate usage. All @examples use Vue 3 <script setup> — vue-query supports Vue 2.6+/3.3+ via vue-demi, but the composable API surface is identical either way, and this matches every existing vue-query doc.

Reactivity notes baked into the JSDoc, per docs/framework/vue/reactivity.md:

  • queryKey/enabled track reactive dependencies (ref, plain value, or a reactive getter () => ...); other options are read once.
  • queryOptions/infiniteQueryOptions/mutationOptions have an extra getter-function overload (() => ({...})) beyond react-query's plain-object-only shape — confirmed via __tests__/queryOptions.test-d.ts/mutationOptions.test-d.ts. Documented as the pattern for keeping queryClient.invalidateQueries/fetchQuery reading current ref values instead of ones captured at options-creation time.

What's lost, and how it was handled:

  • hydration.md's per-option field descriptions (shouldDehydrateMutation, serializeData, shouldRedactErrors, hydrate's defaultOptions) don't survive — dehydrate/hydrate are re-exported from @tanstack/query-core, which is excluded from every adapter's TypeDoc entry point (same tradeoff as react/preact/solid). Unlike react (which left this gap unfilled), this PR recovers it: the option descriptions are folded into guides/ssr.md's existing "Tips, Tricks and Caveats" section as a new ## dehydrate/hydrate options subsection, rather than resurrecting a flat reference/hydration.md page (which would go stale — the framework's convention is generated-only under reference/).
  • useQuery.md's vue-specific caveat on select ("since a Vue setup() function only runs once per component instance, an inline select function already has a stable reference") isn't something a mapped-type option object (QueryOptions) can carry per-field JSDoc for — added to queryOptions.ts's QueryOptions type-level JSDoc instead, where it now shows up on every generated options reference page.
  • Per-option field descriptions for options vue-query doesn't re-declare itself (retry, gcTime, networkMode, select's core behavior, etc.) don't survive, since @tanstack/query-core is excluded from every adapter's TypeDoc entry point and these fields live on core types — this mirrors the react/preact/solid tradeoff exactly, not a new vue-specific loss.
  • Fixed two links in overview.md/reactivity.md still pointing at the old flat reference/useQuery path.

All 13 other deleted pages (infiniteQueryOptions.md, mutationOptions.md, queryOptions.md, useInfiniteQuery.md, useIsFetching.md, useIsMutating.md, useMutation.md, useMutationState.md, usePrefetchInfiniteQuery.md, usePrefetchQuery.md, useQueries.md, useQuery.md, useQueryClient.md) were verified line-by-line against their replacement pages — no other content loss found.

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

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

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

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.

@nx-cloud

nx-cloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 7e996f0

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 2m 19s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 12s View ↗

☁️ Nx Cloud last updated this comment at 2026-09-03 06:35:32 UTC

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

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

🟨 Minor bumps

Package Version Reason
@tanstack/svelte-query 6.1.48 → 6.2.0 Changeset
@tanstack/svelte-query-devtools 6.1.48 → 6.2.0 Dependent
@tanstack/svelte-query-persist-client 6.1.48 → 6.2.0 Dependent
@tanstack/vue-query-devtools 6.1.48 → 6.2.0 Dependent

🟩 Patch bumps

Package Version Reason
@tanstack/query-core 5.102.8 → 5.102.9 Changeset
@tanstack/angular-query-experimental 5.102.8 → 5.102.9 Dependent
@tanstack/angular-query-persist-client 5.102.8 → 5.102.9 Dependent
@tanstack/eslint-plugin-query 5.102.8 → 5.102.9 Dependent
@tanstack/lit-query 0.2.20 → 0.2.21 Dependent
@tanstack/preact-query 5.102.8 → 5.102.9 Dependent
@tanstack/preact-query-devtools 5.102.8 → 5.102.9 Dependent
@tanstack/preact-query-persist-client 5.102.8 → 5.102.9 Dependent
@tanstack/query-async-storage-persister 5.102.8 → 5.102.9 Dependent
@tanstack/query-broadcast-client-experimental 5.102.8 → 5.102.9 Dependent
@tanstack/query-devtools 5.102.8 → 5.102.9 Dependent
@tanstack/query-persist-client-core 5.102.8 → 5.102.9 Dependent
@tanstack/query-sync-storage-persister 5.102.8 → 5.102.9 Dependent
@tanstack/react-query 5.102.8 → 5.102.9 Dependent
@tanstack/react-query-devtools 5.102.8 → 5.102.9 Dependent
@tanstack/react-query-next-experimental 5.102.8 → 5.102.9 Dependent
@tanstack/react-query-persist-client 5.102.8 → 5.102.9 Dependent
@tanstack/solid-query 5.102.8 → 5.102.9 Dependent
@tanstack/solid-query-devtools 5.102.8 → 5.102.9 Dependent
@tanstack/solid-query-persist-client 5.102.8 → 5.102.9 Dependent
@tanstack/vue-query 5.102.8 → 5.102.9 Dependent

@pkg-pr-new

pkg-pr-new Bot commented Sep 3, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@11378

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 7e996f0

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.87 KB (0%)
react minimal 8.84 KB (0%)

@sukvvon sukvvon self-assigned this Sep 3, 2026
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