Skip to content

Conversation

@birkskyum
Copy link
Member

@birkskyum birkskyum commented Oct 28, 2025

closes #9713

Solid query on the server hangs forever, because it always needs experimental_prefetchInRender:true on the server, but that's off by default. Since it always have to be on on the server, this PR detects isServer and set it true. It's because createResource uses promises.

Summary by CodeRabbit

  • Enhancements
    • Optimized server-side rendering data prefetch behavior for improved efficiency during SSR operations.

@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2025

⚠️ No Changeset found

Latest commit: bedefb6

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 28, 2025

Walkthrough

The change enables server-side SSR prefetch in solid-query's useBaseQuery by setting experimental_prefetchInRender to true in default server options, altering the timing of SSR data fetches to support createResource instead of waiting for effects.

Changes

Cohort / File(s) Change Summary
SSR Prefetch Configuration
packages/solid-query/src/useBaseQuery.ts
Enables experimental prefetch-in-render for server-side queries by setting defaultOptions.experimental_prefetchInRender = true with explanatory comments; modifies SSR data fetch timing to support createResource

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the flag setting is correctly scoped to server-side execution only
  • Confirm that enabling prefetch-in-render doesn't break existing SSR test cases or introduce race conditions
  • Validate the interaction with createResource and prior effects-based SSR behavior

Possibly related PRs

Poem

🐰 With prefetchInRender now set to true,
SSR queries dance in synchrony anew,
createResource blooms on server-side soil,
No more waiting for effects to toil,
Solid rendering, swift and bright! 🌟

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description does not follow the required template structure. While the author provides some substantive information about the problem (Solid Query hanging on the server) and the solution (enabling experimental_prefetchInRender by default on the server), the description is missing all major template sections including the "🎯 Changes" section header, the "✅ Checklist" section with required items about following the contributing guide and testing locally, and the "🚀 Release Impact" section to confirm whether a changeset is needed or if this is a dev-only change. The description appears to be a minimal explanation rather than a complete adherence to the expected format. The author should update the pull request description to follow the provided template structure. This means adding the "🎯 Changes" section with a proper description of the changes and motivation, including the "✅ Checklist" section with checkboxes indicating that the contributing guide was followed and local testing was performed, and adding the "🚀 Release Impact" section to specify whether this change requires a changeset or if it is dev-only. The substantive content about the issue and fix should be incorporated into the "🎯 Changes" section.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "fix(solid-query): enable experimental_prefetchInRender by default for…" is specific, concise, and directly related to the main change in the PR. It clearly indicates that the fix involves enabling the experimental_prefetchInRender flag as a default for Solid Query, which aligns with the file changes shown in the summary (modifications to useBaseQuery.ts to enable SSR prefetch). The title accurately represents the primary change without vague terminology, and it follows standard commit message conventions with the "fix" prefix.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch enable-experimental_prefetchInRender-by-default-for-solid

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.

@nx-cloud
Copy link

nx-cloud bot commented Oct 28, 2025

View your CI Pipeline Execution ↗ for commit bedefb6

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 1m 54s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 9s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-28 01:58:17 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 28, 2025

More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@9822

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@9822

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@9822

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@9822

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@9822

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@9822

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@9822

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@9822

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@9822

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@9822

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@9822

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@9822

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@9822

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@9822

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@9822

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@9822

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@9822

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@9822

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@9822

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@9822

commit: bedefb6

@github-actions
Copy link
Contributor

Sizes for commit bedefb6:

Branch Bundle Size
Main
This PR

@codecov
Copy link

codecov bot commented Oct 28, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 76.39%. Comparing base (38b4008) to head (bedefb6).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #9822       +/-   ##
===========================================
+ Coverage   45.74%   76.39%   +30.65%     
===========================================
  Files         200       19      -181     
  Lines        8404      394     -8010     
  Branches     1919       81     -1838     
===========================================
- Hits         3844      301     -3543     
+ Misses       4112       76     -4036     
+ Partials      448       17      -431     
Components Coverage Δ
@tanstack/angular-query-experimental ∅ <ø> (∅)
@tanstack/eslint-plugin-query ∅ <ø> (∅)
@tanstack/query-async-storage-persister ∅ <ø> (∅)
@tanstack/query-broadcast-client-experimental ∅ <ø> (∅)
@tanstack/query-codemods ∅ <ø> (∅)
@tanstack/query-core ∅ <ø> (∅)
@tanstack/query-devtools ∅ <ø> (∅)
@tanstack/query-persist-client-core ∅ <ø> (∅)
@tanstack/query-sync-storage-persister ∅ <ø> (∅)
@tanstack/query-test-utils ∅ <ø> (∅)
@tanstack/react-query ∅ <ø> (∅)
@tanstack/react-query-devtools ∅ <ø> (∅)
@tanstack/react-query-next-experimental ∅ <ø> (∅)
@tanstack/react-query-persist-client ∅ <ø> (∅)
@tanstack/solid-query 77.81% <0.00%> (-0.26%) ⬇️
@tanstack/solid-query-devtools 61.90% <ø> (ø)
@tanstack/solid-query-persist-client 100.00% <ø> (ø)
@tanstack/svelte-query ∅ <ø> (∅)
@tanstack/svelte-query-devtools ∅ <ø> (∅)
@tanstack/svelte-query-persist-client ∅ <ø> (∅)
@tanstack/vue-query ∅ <ø> (∅)
@tanstack/vue-query-devtools ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Solid Query breaks Astro SSR

2 participants