-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix: Add useSuspenseQuery replacement rule for Solid docs #9815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
|
WalkthroughThe documentation for Solid Query's request-waterfalls guide is updated to add replacement mappings for suspense-related hooks ( Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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
| 'useSuspenseQuery': 'useQuery', | ||
| 'useSuspenseQueries': 'useQueries', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 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.mdLength 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.
Description
Fixes #9654
Solid Query documentation incorrectly shows
useSuspenseQuerywhich doesn't exist in Solid Query. This PR adds replacement rules to convertuseSuspenseQuerytouseQueryanduseSuspenseQueriestouseQueries.Changes Made
'useSuspenseQuery': 'useQuery'to replacement rules'useSuspenseQueries': 'useQueries'to replacement rulesdocs/framework/solid/guides/request-waterfalls.mdProblem
The Solid Query documentation shows examples using
useSuspenseQueryanduseSuspenseQuerieswhich 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
useQueryanduseQueriesinstead of the non-existentuseSuspenseQueryhooks.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