Skip to content

fix(solid-query): Avoid context lookup inside memo#10741

Open
Gujiassh wants to merge 2 commits into
TanStack:mainfrom
Gujiassh:fix/solid-query-client-memo
Open

fix(solid-query): Avoid context lookup inside memo#10741
Gujiassh wants to merge 2 commits into
TanStack:mainfrom
Gujiassh:fix/solid-query-client-memo

Conversation

@Gujiassh
Copy link
Copy Markdown

@Gujiassh Gujiassh commented May 20, 2026

Summary

  • avoid calling useQueryClient from inside the Solid createMemo callback by reading QueryClientContext once at setup time
  • preserve explicit queryClient option behavior before falling back to context
  • declare the Solid devtools runtime dependencies as peers so package consumers get the required Solid/Kobalte primitives

Verification

  • pnpm --filter @tanstack/solid-query test:types:tscurrent
  • pnpm --filter @tanstack/query-devtools test:types:tscurrent
  • git diff --check

Summary by CodeRabbit

Release Notes

  • Chores
    • Clarified peer dependency requirements for the query-devtools package, specifying required Solid.js and related library versions to ensure proper installation and compatibility.
    • Internal refactoring for improved dependency resolution and initialization.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 325f0aa1-34a5-4a70-9dc2-0300387d1a70

📥 Commits

Reviewing files that changed from the base of the PR and between 48b7d66 and c7094be.

📒 Files selected for processing (2)
  • packages/query-devtools/package.json
  • packages/solid-query/src/useBaseQuery.ts

📝 Walkthrough

Walkthrough

The PR updates Solid Query's dependency structure and QueryClient resolution. query-devtools declares Solid/Kobalte packages as peer dependencies, and useBaseQuery refactors to retrieve QueryClient directly via context instead of through a wrapper hook.

Changes

Solid Query Integration and Dependency Management

Layer / File(s) Summary
Query DevTools Peer Dependencies
packages/query-devtools/package.json
Solid/Kobalte-related packages (@kobalte/core, solid-js, clsx, goober, @solid-primitives/*, solid-transition-group, @tanstack/match-sorter-utils) are moved from devDependencies to a new peerDependencies block with explicit version ranges.
QueryClient Context Retrieval Refactor
packages/solid-query/src/useBaseQuery.ts
useBaseQuery imports useContext and refactors the client memo to prefer an optional queryClient accessor, then fall back to QueryClientContext via useContext, throwing if neither is available. The useQueryClient import is removed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 With context in paw, peer deps declared,
QueryClient flows without wrapper's care,
Solid foundations, both clean and light,
Dependencies named, and clients in sight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: avoiding context lookup inside a memo in solid-query, which is the primary objective of the PR.
Description check ✅ Passed The description covers the key changes with clear bullet points and includes verification steps, though it deviates from the template structure by using a custom format instead of the suggested template sections.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

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