test(solid-start): fix solid-query when used in ssr #5665
main fromrefs/pull/5665/head·merged by birkskyum(GitHub profile, opens in a new tab) - 1
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: router-ssr-query-core
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: solid-router-ssr-query
View your CI Pipeline Execution ↗ for commit 3ac02b84bff9c8d187a5857819ce23d06a42458d
Command Status Duration Result nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded 42s View ↗ nx run-many --target=build --exclude=examples/*...✅ Succeeded 4s View ↗
☁️ Nx Cloud last updated this comment at
2025-10-28 02:26:33UTCMore templates
- tanstack-router-solid-example-basic
- tanstack-router-solid-example-basic-devtools-panel
- tanstack-router-solid-example-basic-file-based
- tanstack-router-solid-example-basic-non-nested-devtools
- tanstack-router-solid-example-basic-solid-query
- tanstack-router-solid-example-basic-solid-query-file-based
- tanstack-router-solid-example-basic-ssr-streaming-file-based
- tanstack-router-solid-example-kitchen-sink-file-based
- tanstack-router-solid-example-kitchen-sink-solid-query
- tanstack-router-solid-example-kitchen-sink-solid-query-file-based
- tanstack-router-solid-example-quickstart-file-based
- tanstack-solid-start-example-bare
- tanstack-solid-start-example-basic
- tanstack-solid-start-example-basic-auth
- tanstack-solid-start-example-basic-cloudflare
- tanstack-solid-start-example-basic-netlify
- tanstack-solid-start-example-basic-nitro
- tanstack-start-example-basic-solid-query
- tanstack-solid-start-example-basic-static
- tanstack-router-react-example-authenticated-routes
- tanstack-router-react-example-authenticated-routes-firebase
- tanstack-router-react-example-basic
- tanstack-router-react-example-basic-default-search-params
- tanstack-router-react-example-basic-devtools-panel
- tanstack-router-react-example-basic-file-based
- tanstack-router-react-example-basic-non-nested-devtools
- tanstack-router-react-example-react-query
- tanstack-router-react-example-basic-react-query-file-based
- tanstack-router-react-example-basic-ssr-file-based
- tanstack-router-react-example-basic-ssr-streaming-file-based
- tanstack-router-react-example-basic-virtual-file-based
- tanstack-router-react-example-basic-virtual-inside-file-based
- tanstack-router-react-example-deferred-data
- tanstack-router-i18n-paraglide
- tanstack-router-react-example-kitchen-sink
- tanstack-router-react-example-kitchen-sink-file-based
- tanstack-router-react-example-kitchen-sink-react-query
- tanstack-router-react-example-kitchen-sink-react-query-file-based
- tanstack-router-react-example-large-file-based
- tanstack-router-react-example-location-masking
- tanstack-router-react-example-navigation-blocking
- tanstack-router-react-example-quickstart
- tanstack-router-react-example-quickstart-esbuild-file-based
- tanstack-router-react-example-quickstart-file-based
- tanstack-router-react-example-quickstart-rspack-file-based
- tanstack-router-react-example-quickstart-webpack-file-based
- router-monorepo-react-query
- router-mono-simple
- router-mono-simple-lazy
- tanstack-router-react-example-scroll-restoration
- tanstack-search-validator-adapters
- tanstack-start-example-bare
- tanstack-start-example-basic
- tanstack-start-example-basic-auth
- tanstack-start-example-basic-cloudflare
- tanstack-start-example-basic-react-query
- tanstack-start-example-basic-static
- tanstack-start-bun-hosting
- tanstack-start-example-clerk-basic
- tanstack-start-example-convex-trellaux
- tanstack-start-example-counter
- tanstack-start-i18n-paraglide
- tanstack-start-example-large
- tanstack-start-example-material-ui
- tanstack-start-streaming-data-from-server-functions
- tanstack-start-example-supabase-basic
- tanstack-start-tailwind-v4
- tanstack-start-example-trellaux
- tanstack-start-example-workos
- tanstack-router-react-example-view-transitions
- tanstack-router-react-example-with-framer-motion
- tanstack-router-react-example-with-trpc
- tanstack-router-react-example-with-trpc-react-query
@tanstack/arktype-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5665@tanstack/directive-functions-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5665@tanstack/eslint-plugin-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5665@tanstack/history
npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5665@tanstack/nitro-v2-vite-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5665@tanstack/react-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5665@tanstack/react-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5665@tanstack/react-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5665@tanstack/react-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5665@tanstack/react-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5665@tanstack/react-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5665@tanstack/router-cli
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5665@tanstack/router-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5665@tanstack/router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5665@tanstack/router-devtools-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5665@tanstack/router-generator
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5665@tanstack/router-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5665@tanstack/router-ssr-query-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5665@tanstack/router-utils
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5665@tanstack/router-vite-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5665@tanstack/server-functions-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5665@tanstack/solid-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5665@tanstack/solid-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5665@tanstack/solid-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@5665@tanstack/solid-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5665@tanstack/solid-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5665@tanstack/solid-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5665@tanstack/start-client-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5665@tanstack/start-plugin-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5665@tanstack/start-server-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5665@tanstack/start-static-server-functions
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5665@tanstack/start-storage-context
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5665@tanstack/valibot-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5665@tanstack/virtual-file-routes
npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5665@tanstack/zod-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5665commit:
3ac02b8birkskyum(GitHub profile, opens in a new tab) changed the title
Actionable comments posted: 0
🧹 Nitpick comments (1)
e2e/solid-start/query-integration/src/router.tsx (1)
7-13: QueryClient configuration is correct but note code duplication.The QueryClient configuration with
experimental_prefetchInRender: truealigns with the PR objective. However, this identical configuration appears across multiple test router files (server-functions, basic-solid-query, and query-integration). While this duplication is reasonable for isolated e2e test suites, consider whether a shared factory function could reduce maintenance if this pattern expands.Minor style note: Line 13 has a semicolon while the equivalent line in
e2e/solid-start/server-functions/src/router.tsxdoes not. Consider standardizing for consistency.📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between e2be32a9b5a9e0a3a58d8abcf4b9663588b4aeae and 0cdc0eaa4060f74b0e4658d5f79e0add8fa8b0d2.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
e2e/solid-start/basic-solid-query/src/router.tsx(1 hunks)e2e/solid-start/query-integration/src/router.tsx(1 hunks)e2e/solid-start/query-integration/src/routes/useQuery.tsx(1 hunks)e2e/solid-start/server-functions/src/router.tsx(1 hunks)e2e/solid-start/server-functions/src/routes/primitives/index.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript in strict mode with extensive type safety across the codebase
Files:
e2e/solid-start/query-integration/src/router.tsxe2e/solid-start/server-functions/src/routes/primitives/index.tsxe2e/solid-start/query-integration/src/routes/useQuery.tsxe2e/solid-start/basic-solid-query/src/router.tsxe2e/solid-start/server-functions/src/router.tsx
e2e/**
📄 CodeRabbit inference engine (AGENTS.md)
Store end-to-end tests under the e2e/ directory
Files:
e2e/solid-start/query-integration/src/router.tsxe2e/solid-start/server-functions/src/routes/primitives/index.tsxe2e/solid-start/query-integration/src/routes/useQuery.tsxe2e/solid-start/basic-solid-query/src/router.tsxe2e/solid-start/server-functions/src/router.tsx
**/src/routes/**
📄 CodeRabbit inference engine (AGENTS.md)
Place file-based routes under src/routes/ directories
Files:
e2e/solid-start/server-functions/src/routes/primitives/index.tsxe2e/solid-start/query-integration/src/routes/useQuery.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). (1)
- GitHub Check: Preview
🔇 Additional comments (4)
e2e/solid-start/server-functions/src/router.tsx (1)
9-15: LGTM! Configuration enables prefetch-in-render for SSR testing.The QueryClient configuration with
experimental_prefetchInRender: truealigns with the PR objective to fix solid-query SSR behavior. This is appropriate for an e2e test environment where consistent SSR/CSR prefetch behavior is desired.e2e/solid-start/basic-solid-query/src/router.tsx (1)
12-12: Enabling prefetch-in-render for SSR is appropriate for this test.The change from
typeof window !== 'undefined'totrueenables prefetching during server-side rendering, which is consistent with the PR's objective to fix solid-query SSR behavior. This unconditional enablement is appropriate for e2e testing.e2e/solid-start/query-integration/src/routes/useQuery.tsx (1)
10-10: No issues found. The SSR configuration change is valid.The
ssrproperty is typed asSSROption = boolean | 'data-only'in the router core package. Bothtrueand'data-only'are valid SSROption values, making the change from'data-only'totruea properly typed transformation.e2e/solid-start/server-functions/src/routes/primitives/index.tsx (1)
8-8: No issues found after verification.The change from
ssr: 'data-only'tossr: trueis valid and intentional. Both values are supported by TanStack Start'screateFileRouteAPI—trueenables full server-side rendering (both data loading and component rendering), while'data-only'only renders data on the server. For a route dedicated to testing server functions with primitive types, full SSR is semantically appropriate and ensures the component is properly rendered with server function results server-side.birkskyum(GitHub profile, opens in a new tab) approved these changes
birkskyum(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Walkthrough#
Enable QueryClient's experimental_prefetchInRender by default in multiple Solid Start router setups and change several route SSR configurations from the string
'data-only'to the booleantrue.Changes#
e2e/solid-start/basic-solid-query/src/router.tsx,e2e/solid-start/query-integration/src/router.tsx,e2e/solid-start/server-functions/src/router.tsxdefaultOptions.queries.experimental_prefetchInRender = true, removing environment checks and always enabling prefetch-in-render.e2e/solid-start/query-integration/src/routes/useQuery.tsx,e2e/solid-start/server-functions/src/routes/primitives/index.tsxssrvalue replaced from'data-only'string to booleantrue.Sequence Diagram(s)#
Estimated code review effort#
🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related issues#
'data-only'tossr: truefor useQuery and related SSR behavior.Possibly related PRs#
Suggested labels#
package: solid-startSuggested reviewers#
Poem#
Pre-merge checks and finishing touches#
❌ Failed checks (1 warning)
@coderabbitai generate docstringsto improve docstring coverage.✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 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 0cdc0eaa4060f74b0e4658d5f79e0add8fa8b0d2 and 9e116c8be5beaa8ebb99df47fe8527c1b1f4ddd8.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml📒 Files selected for processing (5)
e2e/solid-start/basic-solid-query/src/router.tsx(1 hunks)e2e/solid-start/query-integration/src/router.tsx(1 hunks)e2e/solid-start/query-integration/src/routes/useQuery.tsx(1 hunks)e2e/solid-start/server-functions/src/router.tsx(1 hunks)e2e/solid-start/server-functions/src/routes/primitives/index.tsx(1 hunks)🚧 Files skipped from review as they are similar to previous changes (3)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Files:
e2e/solid-start/server-functions/src/routes/primitives/index.tsxe2e/solid-start/basic-solid-query/src/router.tsx**/src/routes/**
📄 CodeRabbit inference engine (AGENTS.md)
Files:
e2e/solid-start/server-functions/src/routes/primitives/index.tsxe2e/**
📄 CodeRabbit inference engine (AGENTS.md)
Files:
e2e/solid-start/server-functions/src/routes/primitives/index.tsxe2e/solid-start/basic-solid-query/src/router.tsx🔇 Additional comments (2)
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