Skip to content

Conversation

@GEREGUR
Copy link

@GEREGUR GEREGUR commented Nov 15, 2025

React docs use object syntax inside useQuery({...}), useMutation({...}) and etc., but Solid requires a function returning an object: useQuery(() => ({ ... })). The current replace rule only prepends () => but does not wrap the object in parentheses, causing Solid examples to return undefined. This PR removes the useQuery, useMutation and etc replace rules.

🎯 Changes

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

I didn’t run pnpm run test:pr because this PR does not modify any runtime or documentation build logic. Instead, it proposes a call for correction the Solid-specific documentation to fix a misunderstanding caused by the automatic React → Solid transformation. The current transformation produces invalid Solid examples, so this PR just comments out search&replace rule to call out about incorrect examples of code rather than providing a code fix that would require tests.

🚀 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
    • Updated framework integration guide by modifying hook mapping references.

React docs use object syntax inside useQuery({...}), but Solid requires a function returning an object: useQuery(() => ({ ... })).
The current replace rule only prepends () => but does not wrap the object in parentheses, causing Solid examples to return undefined.
This PR removes the useQuery replace rule and manually updates Solid examples to the correct Solid signature.
@changeset-bot
Copy link

changeset-bot bot commented Nov 15, 2025

⚠️ No Changeset found

Latest commit: 98328d6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Nov 15, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 15, 2025

Walkthrough

Four active text replacement mappings in the Solid documentation for React hook equivalents (useMutationState, useMutation, useQuery, useQueries) are disabled by converting them to HTML comments, removing their functional replacement behavior.

Changes

Cohort / File(s) Change Summary
Documentation Configuration
docs/framework/solid/guides/queries.md
Disabled React-to-Solid hook replacement mappings for useMutationState, useMutation, useQuery, and useQueries by converting active entries to commented-out placeholders

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single file modification affecting configuration/documentation mappings only
  • Changes are purely cosmetic (commenting out existing entries without introducing new logic)

Possibly related PRs

  • TanStack/query#9815: Modifies Solid documentation replacement rules and directly involves the same mapping targets (useQuery, useQueries)

Suggested labels

documentation

Poem

🐰 Hooks in comments now rest and hide,
React replacements swept aside,
Solid paths no longer mapped with haste,
Documentation cleaned with taste,
Simpler rules now take their place! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: commenting out automatic search and replace rules in Solid documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description is well-structured and follows the template with all required sections completed, explaining the technical issue, motivation, and the justification for not running tests.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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.

@TkDodo
Copy link
Collaborator

TkDodo commented Nov 25, 2025

so this code:

const result = useQuery(() => { queryKey: ['todos'], queryFn: fetchTodoList })

should become:

const result = useQuery(() => ({ queryKey: ['todos'], queryFn: fetchTodoList }))

so we’re just missing two parentheses. Can you add those instead please?

@GEREGUR
Copy link
Author

GEREGUR commented Nov 25, 2025

so we’re just missing two parentheses. Can you add those instead please?

Currently, all code examples are being transformed using a simple search-and-replace rule like:
'useQuery[(]': 'useQuery(() => '
The issue is that we also need to ensure the closing parenthesis is duplicated, and this cannot be reliably solved with basic search & replace. You can try to hack something together with complex regexes, but it’s fragile — especially when dealing with multiline code examples.

My guess is proper fix would require using AST-based code transformations with a JavaScript parser, but that would mean changing the existing doc build pipeline. If you are okay with that, I can hack my way around and try to implement this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants