Skip to content

Conversation

@mkmlab-v2
Copy link

@mkmlab-v2 mkmlab-v2 commented Oct 26, 2025

Description

Fixes #9654

Solid Query documentation incorrectly shows useSuspenseQuery which doesn't exist in Solid Query. This PR adds replacement rules to convert useSuspenseQuery to useQuery and useSuspenseQueries to useQueries.

Changes Made

  • Added 'useSuspenseQuery': 'useQuery' to replacement rules
  • Added 'useSuspenseQueries': 'useQueries' to replacement rules
  • File: docs/framework/solid/guides/request-waterfalls.md

Problem

The Solid Query documentation shows examples using useSuspenseQuery and useSuspenseQueries which are React-specific hooks. These hooks don't exist in Solid Query. When users try to use these examples in their Solid code, they encounter errors.

Solution

The documentation uses an automatic replacement system to convert React code examples to Solid. By adding these two replacement rules, the documentation will now correctly show useQuery and useQueries instead of the non-existent useSuspenseQuery hooks.

Testing

This is a documentation-only change. The replacement rules will ensure that future documentation builds will show the correct Solid Query API calls.

Screenshots

N/A - Documentation change only

Related Issues

Closes #9654

Summary by CodeRabbit

  • Documentation
    • Added new documentation covering additional hook alias mappings for suspense-related queries, expanding framework guides with more comprehensive reference material for available query hook options and their cross-framework equivalents.

Fixes TanStack#9654

Solid Query documentation incorrectly shows useSuspenseQuery which doesn't exist in Solid Query. Added replacement rules to convert useSuspenseQuery to useQuery and useSuspenseQueries to useQueries.

This aligns the documentation with the actual Solid Query API.
@changeset-bot
Copy link

changeset-bot bot commented Oct 26, 2025

⚠️ No Changeset found

Latest commit: 077616f

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 26, 2025

Walkthrough

The documentation for Solid Query's request-waterfalls guide is updated to add replacement mappings for suspense-related hooks (useSuspenseQuery and useSuspenseQueries) to their non-suspense equivalents (useQuery and useQueries), addressing references to non-existent Solid Query APIs in code examples.

Changes

Cohort / File(s) Summary
Solid Query Hook Alias Mappings
docs/framework/solid/guides/request-waterfalls.md
Adds two new replacement mappings for suspense-related hooks that don't exist in Solid Query, routing them to their standard counterparts

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Verify the hook mappings align with Solid Query's actual API surface
  • Confirm that aliasing useSuspenseQueryuseQuery is the intended resolution per the library's design

Suggested labels

documentation

Suggested reviewers

  • TkDodo

Poem

🐰 A rabbit hops through docs so grand,
Finding hooks that slipped through sand,
With gentle maps and aliases true,
useSuspenseQueryuseQuery shines anew! ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description does not follow the required template structure specified in the repository. While the description provides comprehensive and well-organized information about the changes, problem, and solution, it is missing critical mandatory sections from the template including the "## ✅ Checklist" section (with the Contributing guide and test verification steps) and the "## 🚀 Release Impact" section (with the changeset and release type indicators). These template sections are essential components that should be completed before merge.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "fix: Add useSuspenseQuery replacement rule for Solid docs" accurately and concisely summarizes the primary change in the changeset. The title clearly indicates that the PR adds a replacement rule for useSuspenseQuery specifically for Solid documentation, which directly aligns with the actual modification of adding two new replacement mappings in the documentation conversion system.
Linked Issues Check ✅ Passed The PR successfully addresses the primary coding objective from issue #9654 by adding replacement rules that map useSuspenseQuery to useQuery and useSuspenseQueries to useQueries. These changes ensure that the Solid Query documentation examples will reference real, existing functions instead of non-existent React-specific hooks, preventing users from encountering errors when following the documentation. The implementation directly solves the core issue of incorrect function references in the documentation examples.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Oct 26, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 38b4008 and 077616f.

📒 Files selected for processing (1)
  • docs/framework/solid/guides/request-waterfalls.md (1 hunks)

Comment on lines +14 to +15
'useSuspenseQuery': 'useQuery',
'useSuspenseQueries': 'useQueries',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify that replacements produce accurate Solid documentation.

The replacement rules pragmatically map non-existent Solid Query Suspense variants to their standard equivalents. However, the PR objectives note uncertainty about whether React-specific Suspense explanations apply to Solid. After the replacements are applied, the explanatory text may still reference React's Suspense behavior, which could be misleading for Solid users.

Consider whether the documentation body itself (not just function names) needs adjustment to clarify Solid's Suspense semantics.

To verify the documentation renders correctly:


🏁 Script executed:

#!/bin/bash
# Description: Verify that the replacement rules are correctly applied to the documentation

# 1. Locate the React source file that is referenced
REACT_SOURCE="docs/framework/react/guides/request-waterfalls.md"

# 2. Check if the React source file exists
if [[ -f "$REACT_SOURCE" ]]; then
  echo "✓ React source file found: $REACT_SOURCE"
  
  # 3. Verify that useSuspenseQuery and useSuspenseQueries appear in React docs
  echo "Checking for useSuspenseQuery in React docs:"
  rg -n "useSuspenseQuery" "$REACT_SOURCE"
  
  echo "Checking for useSuspenseQueries in React docs:"
  rg -n "useSuspenseQueries" "$REACT_SOURCE"
else
  echo "✗ React source file not found: $REACT_SOURCE"
fi

# 4. Check the Solid docs frontmatter to ensure the replacements are defined
echo "Verifying Solid replacement rules are in place:"
rg -A 2 "useSuspenseQuery.*useQuery" docs/framework/solid/guides/request-waterfalls.md
rg -A 2 "useSuspenseQueries.*useQueries" docs/framework/solid/guides/request-waterfalls.md

Length of output: 1219


I need to examine the explanation text in the React source to assess whether the semantic content remains accurate after the replacements are applied.

Documentation replacement rules are pragmatic but require content review for semantic accuracy.

The replacement rules correctly map non-existent Solid Query variants to their equivalents. However, Solid Query uses Solid's Suspense API differently—wrapping components with a Suspense component and using an async suspense function from solid-query, rather than separate hook variants like React's useSuspenseQuery.

After replacements are applied, explanatory text (e.g., "use useQuery when...") will become misleading because it describes Solid's standard useQuery hook without clarifying the Suspense-specific setup that Solid Query actually requires. Verify that the documentation body is manually adjusted to explain Solid's Suspense pattern rather than simply relying on function name replacements.

🤖 Prompt for AI Agents
In docs/framework/solid/guides/request-waterfalls.md around lines 14-15, the
automated replacement mapping 'useSuspenseQuery'→'useQuery' and
'useSuspenseQueries'→'useQueries' leaves explanatory text inaccurate for Solid:
Solid Query requires using Solid's Suspense component and the library's
async-suspense helpers (not React-style suspense hooks). Update the prose to
explain Solid's pattern — describe wrapping components with <Suspense>, using
solid-query's async suspense API (or async wrappers) and how to use
useQuery/useQueries within that pattern — and remove or reword any guidance that
implies React-style "useSuspense*" hooks exist.

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.

Solid Query docs: Code examples with useSuspenseQuery that don't exist

1 participant