Skip to content

Conversation

@brenelz
Copy link
Contributor

@brenelz brenelz commented Oct 28, 2025

🎯 Changes

So when working on tanstack router for solid we have an issue where solid query is hanging. I narrowed it down to this commit

v5.85.4...v5.85.5

So i added a piece of it back which seems to stop it from hanging. I am not sure of the impact but its in query-core so a little scary.

✅ Checklist

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

🚀 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

  • New Features

    • Solid Query integration for streaming apps with Suspense-driven loading state and built-in query usage.
    • Experimental prefetch-in-render capability added, guarded by a feature flag to avoid unexpected runtime behavior.
  • Bug Fixes

    • Patch update to address hanging behavior in Solid Query during render-time prefetching.

@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2025

🦋 Changeset detected

Latest commit: dbe32ec

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@tanstack/query-core Patch
@tanstack/angular-query-experimental Patch
@tanstack/query-async-storage-persister Patch
@tanstack/query-broadcast-client-experimental Patch
@tanstack/query-persist-client-core Patch
@tanstack/query-sync-storage-persister Patch
@tanstack/react-query Patch
@tanstack/solid-query Patch
@tanstack/svelte-query Patch
@tanstack/vue-query Patch
@tanstack/angular-query-persist-client Patch
@tanstack/react-query-persist-client Patch
@tanstack/solid-query-persist-client Patch
@tanstack/svelte-query-persist-client Patch
@tanstack/react-query-devtools Patch
@tanstack/react-query-next-experimental Patch
@tanstack/solid-query-devtools Patch
@tanstack/svelte-query-devtools Patch
@tanstack/vue-query-devtools Patch

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 28, 2025

Walkthrough

Adds Solid Query usage to the streaming example (Home route) with a Suspense-rendered useQuery, and adds experimental_prefetchInRender feature-flag guards in queryObserver to reject the thenable during construction and when tracking results if the flag is disabled.

Changes

Cohort / File(s) Summary
Solid streaming example
examples/solid/solid-start-streaming/src/routes/index.tsx
Adds a memoized queryOptions factory and useQuery usage in Home; wraps query output in a Suspense boundary and renders data or a loading placeholder with data-testid="query-data".
Query observer feature-flag guards
packages/query-core/src/queryObserver.ts
Enforces experimental_prefetchInRender flag: rejects the initial thenable in the constructor when disabled and rejects/access guards during trackResult when a thenable is pending.
Changeset / Manifest
.changeset/fuzzy-dolls-hang.md, package.json
Adds a changeset documenting a patch and updates package manifest entries related to the change.

Sequence Diagram(s)

sequenceDiagram
    participant App as Solid App
    participant Home as Home Route
    participant Suspense as Suspense
    participant Observer as QueryObserver
    participant Flag as FeatureFlag

    Note over Home,Suspense: Query render path
    App->>Home: render Home
    Home->>Observer: makeQueryOptions() / useQuery(...)
    Home->>Suspense: render boundary
    alt feature flag enabled
        Observer->>Home: provide thenable/data (normal flow)
        Suspense->>Home: resolves with data -> render `query-data`
    else feature flag disabled
        Observer->>Home: reject thenable in constructor / on access
        Suspense->>Home: shows fallback ("loading...")
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas needing attention:
    • packages/query-core/src/queryObserver.ts — ensure rejection semantics for thenables don't break existing consumers and error messages are clear.
    • examples/solid/.../index.tsx — verify Suspense placement, memoization correctness, and testability of data-testid="query-data".

Possibly related PRs

Suggested reviewers

  • TkDodo

Poem

🐰 Hopping through code at break of day,
I memoize queries and stream away.
Flags keep prefetch from leaping too far,
Suspense holds the carrot — near or far.
🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
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: solid query hangs when not prefetchInRender" is concise, clear, and directly reflects the main objective of the changeset. It accurately describes the bug being addressed—a hanging issue in Solid Query when the prefetchInRender feature is disabled—which aligns with the core changes made to queryObserver.ts and the changeset documentation. The title uses standard commit convention (fix:) and provides enough specificity that a reviewer scanning history would understand the primary change without needing additional context.
Description Check ✅ Passed The PR description follows the required template structure with all three main sections present: 🎯 Changes, ✅ Checklist, and 🚀 Release Impact. The Changes section provides context about the issue (Solid Query hanging), explains how the author identified the root cause (narrowing down to a specific commit range), and describes the fix applied (reintroducing a piece of earlier code). Both checklist items are marked as completed, and the release impact section correctly indicates that published code is affected and a changeset has been generated. While the Changes section could be slightly more detailed about the specific implementation, it provides sufficient information about the problem and solution.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2bbe0e7 and dbe32ec.

📒 Files selected for processing (1)
  • .changeset/fuzzy-dolls-hang.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/fuzzy-dolls-hang.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Preview
  • GitHub Check: Test

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 dbe32ec

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

☁️ Nx Cloud last updated this comment at 2025-10-28 00:30:39 UTC

@codecov
Copy link

codecov bot commented Oct 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.79%. Comparing base (38b4008) to head (dbe32ec).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #9821       +/-   ##
===========================================
+ Coverage   45.74%   59.79%   +14.05%     
===========================================
  Files         200      129       -71     
  Lines        8404     5621     -2783     
  Branches     1919     1528      -391     
===========================================
- Hits         3844     3361      -483     
+ Misses       4112     1955     -2157     
+ Partials      448      305      -143     
Components Coverage Δ
@tanstack/angular-query-experimental 93.85% <ø> (ø)
@tanstack/eslint-plugin-query ∅ <ø> (∅)
@tanstack/query-async-storage-persister 43.85% <ø> (ø)
@tanstack/query-broadcast-client-experimental 24.39% <ø> (ø)
@tanstack/query-codemods ∅ <ø> (∅)
@tanstack/query-core 97.38% <100.00%> (+<0.01%) ⬆️
@tanstack/query-devtools 3.48% <ø> (ø)
@tanstack/query-persist-client-core 80.00% <ø> (ø)
@tanstack/query-sync-storage-persister 84.61% <ø> (ø)
@tanstack/query-test-utils ∅ <ø> (∅)
@tanstack/react-query 96.01% <ø> (ø)
@tanstack/react-query-devtools 10.00% <ø> (ø)
@tanstack/react-query-next-experimental ∅ <ø> (∅)
@tanstack/react-query-persist-client 100.00% <ø> (ø)
@tanstack/solid-query 78.06% <ø> (ø)
@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 71.10% <ø> (ø)
@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.

@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@9821

@tanstack/eslint-plugin-query

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: dbe32ec

@birkskyum birkskyum requested a review from TkDodo October 28, 2025 00:49
@brenelz brenelz closed this Oct 28, 2025
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.

1 participant