Skip to content

Conversation

@sukvvon
Copy link
Contributor

@sukvvon sukvvon commented Dec 28, 2025

🎯 Changes

Add useQueries test for SSR in ssr.test.tsx.

✅ 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

    • The useQueries hook is now part of the public API for managing multiple queries at once.
    • Server-side rendering now supports prefetching and rendering of multiple queries.
  • Tests

    • Added SSR test coverage validating prefetching, cache retrieval, and successful rendering of multiple queries.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Dec 28, 2025

⚠️ No Changeset found

Latest commit: 1e86c8f

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

📝 Walkthrough

Walkthrough

Added an SSR test that exercises useQueries with two queries, prefetches them, and verifies SSR output shows success statuses and cached data. Also exported useQueries from the react-query public API module.

Changes

Cohort / File(s) Summary
Test Coverage
packages/react-query/src/__tests__/ssr.test.tsx
New SSR test using useQueries to prefetch two queries, render SSR markup, and assert both queries are success and their data appear in the rendered output.
Public API Export
packages/react-query/src/index.ts
Re-exported/exported useQueries from the public react-query module so it can be imported from the package root.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • TkDodo
  • manudeli

Poem

"I hopped through tests with queries two,
SSR fields and caches too,
Prefetched crumbs led data near,
Success in markup, tidy and clear —
A rabbit cheers: export's here! 🐇✨"

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 accurately describes the main change: adding a useQueries test for SSR functionality in ssr.test.tsx.
Description check ✅ Passed The PR description follows the required template with all sections completed, including Changes, Checklist, and Release Impact, with appropriate boxes checked.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 73e67fc and 2d4ae0f.

📒 Files selected for processing (1)
  • packages/react-query/src/__tests__/ssr.test.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react-query/src/tests/ssr.test.tsx
⏰ 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

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Dec 28, 2025

View your CI Pipeline Execution ↗ for commit 1e86c8f

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

☁️ Nx Cloud last updated this comment at 2025-12-29 12:23:15 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 28, 2025

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 1e86c8f

@codecov
Copy link

codecov bot commented Dec 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.18%. Comparing base (e907f89) to head (1e86c8f).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #9996       +/-   ##
===========================================
+ Coverage   45.79%   84.18%   +38.38%     
===========================================
  Files         200       26      -174     
  Lines        8520      373     -8147     
  Branches     1975      110     -1865     
===========================================
- Hits         3902      314     -3588     
+ Misses       4158       50     -4108     
+ Partials      460        9      -451     
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 96.67% <ø> (+0.33%) ⬆️
@tanstack/react-query-devtools 9.25% <ø> (ø)
@tanstack/react-query-next-experimental ∅ <ø> (∅)
@tanstack/react-query-persist-client 100.00% <ø> (ø)
@tanstack/solid-query ∅ <ø> (∅)
@tanstack/solid-query-devtools ∅ <ø> (∅)
@tanstack/solid-query-persist-client ∅ <ø> (∅)
@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.

1 participant