Skip to content

docs(preact-query): trim 'queryOptions'/'infiniteQueryOptions' examples to what the factory needs to prove - #11336

Merged
sukvvon merged 1 commit into
mainfrom
docs/preact-query-options-factory-examples-scope
Aug 30, 2026
Merged

docs(preact-query): trim 'queryOptions'/'infiniteQueryOptions' examples to what the factory needs to prove#11336
sukvvon merged 1 commit into
mainfrom
docs/preact-query-options-factory-examples-scope

Conversation

@sukvvon

@sukvvon sukvvon commented Aug 30, 2026

Copy link
Copy Markdown
Member

🎯 Changes

queryOptions.ts's "parameterized factory" example and infiniteQueryOptions.ts's equivalent both appended a queryClient.query(...)/queryClient.infiniteQuery(...) call after the consuming component, introduced by a // see useQuery/useInfiniteQuery for an example that warms the cache this way comment pointing at the hover-prefetch example those two files already carry. Since the hook files (useQuery.ts, useInfiniteQuery.ts) already demonstrate that imperative-call scenario in depth, repeating a truncated version of it here duplicated the pointer without adding anything the reader couldn't get from following it. Removed the trailing imperative-call lines and the now-unused noop import, and reworded the example's caption to describe what it actually shows (reusing the options object per id/postId), since the old caption ("reused across a hook and an imperative call") no longer matched.

queryOptions.ts also had a second example ("The same options object works with every API that accepts query options") that, once its own trailing queryClient.query(...)/getQueryData(...) calls are held to the same standard, becomes functionally identical to the first example — same shape, same point, no unique behavior of its own. Removed it entirely rather than trim it down to a near-duplicate of the first.

infiniteQueryOptions.ts had no equivalent second example, so nothing else changed there. mutationOptions.ts already keeps both its examples fully self-contained inside their consuming component — no changes needed.

Regenerated the corresponding reference docs with pnpm run generate-docs.

✅ 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
    • Simplified queryOptions and infiniteQueryOptions examples to focus on reusable, parameterized option factories.
    • Removed imperative query-client usage examples and unnecessary imports.
    • Updated source references and refined example headings and descriptions across the Preact documentation.

@nx-cloud

nx-cloud Bot commented Aug 30, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 487f7c4

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

☁️ Nx Cloud last updated this comment at 2026-08-30 16:01:11 UTC

@sukvvon sukvvon self-assigned this Aug 30, 2026
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Review 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: Pro Plus

Run ID: ff977290-2743-4a72-a06d-d99ef8f9c563

📥 Commits

Reviewing files that changed from the base of the PR and between b53bddb and 487f7c4.

📒 Files selected for processing (4)
  • docs/framework/preact/reference/functions/infiniteQueryOptions.md
  • docs/framework/preact/reference/functions/queryOptions.md
  • packages/preact-query/src/infiniteQueryOptions.ts
  • packages/preact-query/src/queryOptions.ts

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


📝 Walkthrough

Walkthrough

The change updates Preact queryOptions and infiniteQueryOptions examples. The examples now focus on parameterized factories and hooks. Imperative query-client usage and unused noop imports were removed. Reference source line links were updated.

Changes

Preact query options documentation

Layer / File(s) Summary
Update source option examples
packages/preact-query/src/queryOptions.ts, packages/preact-query/src/infiniteQueryOptions.ts
The source examples retain parameterized factories and hooks. Imperative query-client examples and unused noop imports were removed.
Synchronize Preact reference pages
docs/framework/preact/reference/functions/queryOptions.md, docs/framework/preact/reference/functions/infiniteQueryOptions.md
The reference pages update source line links, example headings, wording, imports, and removed imperative usage.

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

Merge Risk: ⚪ Minimal · up to 487f7

This change narrows Preact Query examples and updates the generated references without changing published runtime behavior, so no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description explains the documentation changes, motivation, regeneration step, testing status, and release impact. All required template sections are present and complete.
Title check ✅ Passed The title clearly and concisely describes the main change: trimming redundant queryOptions and infiniteQueryOptions examples.
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.
Full details: Docstring Coverage

Explanation

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 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/preact-query-options-factory-examples-scope

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.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@pkg-pr-new

pkg-pr-new Bot commented Aug 30, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 487f7c4

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.89 KB (0%)
react minimal 8.85 KB (0%)

@sukvvon
sukvvon merged commit ffcf9a3 into main Aug 30, 2026
9 checks passed
@sukvvon
sukvvon deleted the docs/preact-query-options-factory-examples-scope branch August 30, 2026 16:08
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