(fix): commented out automatic search&replace in solid docs#9875
(fix): commented out automatic search&replace in solid docs#9875GEREGUR wants to merge 1 commit intoTanStack:mainfrom
Conversation
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.
|
WalkthroughFour 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
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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.
Example instruction:
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. Comment |
|
so this code: should become: 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: 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 |
|
i have created another pull request with proper fixes, took me a while but finally got this done |
|
Just left a comment on TanStack/tanstack.com#720, describing why we shouldn't be doing this at the markdown processing layer. |
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
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
Summary by CodeRabbit