Skip to content

refactor(solid): retire solid-router-ssr-query — native channels carry the Router + Query pairing - #8193

Draft
ryansolid wants to merge 1 commit into
TanStack:solid-router-v2-prefrom
ryansolid:feat/solid-native-query-ssr
Draft

refactor(solid): retire solid-router-ssr-query — native channels carry the Router + Query pairing#8193
ryansolid wants to merge 1 commit into
TanStack:solid-router-v2-prefrom
ryansolid:feat/solid-native-query-ssr

Conversation

@ryansolid

Copy link
Copy Markdown

Draft — for discussion. Works against published packages today (@tanstack/solid-query@6.0.0-rc.1, solid-js@2.0.0-rc.4); all three converted e2e suites pass.

Summary

On the Solid v2 line, @tanstack/solid-router-ssr-query bundles three unrelated things, and each now has a better home:

  1. SSR transport (the bulk of the package — router-ssr-query-core's dehydrate + query stream + client hydrate). Native to solid-query v6: QueryClientProvider serializes the request's cache into Solid's hydration registry (content-addressed by query hash, promise-valued at fetch-dispatch so pending queries stream, covering never-mounted loader prefetches) and primes the client cache from it. Running the package alongside it ships every query payload twice — which is what the e2e apps were doing: once through the router's dehydration stream, once through the hydration registry.
  2. wrapQueryClient. A JSX expression — the router's own Wrap option:
Wrap: (props) => (
  <QueryClientProvider client={queryClient}>{props.children}</QueryClientProvider>
)
  1. handleRedirects. Runtime navigation glue, not an SSR concern: cache-driven fetches (mount fetches, background refetches, mutations) run outside the router, so a queryFn/mutationFn throwing redirect() needs handing to router.navigate. That's a small userland composition of public APIs on both sides — isRedirect/resolveRedirect from the router, config.onError on the query/mutation caches (see routeCacheRedirects in the converted apps). Loader-driven redirects were never the package's: they propagate through the loader and the router handles them on both sides.

This PR converts the three Solid Start e2e apps (basic-solid-query, server-functions, server-routes) to the composition, removes the dependency, and marks the package deprecated for the v2 line in its README.

Verification

  • basic-solid-query: 6/6 — SSR hydration, nested layouts, suspense transitions, query-preserving navigation, all on the native transport only.
  • server-functions: 29/29 — including redirect-test (mount-time query redirect via the onError glue) and redirect-test-ssr (render-time query redirect resolving through the stream handler), demonstrating handleRedirects is fully replaced.
  • server-routes: 2/2.

Notes

  • The same composition is the reference pattern in solidjs/templates' fullstack-tanstack (bare vite + TanStack Router + Query, no Start — solid-v2/fullstack-tanstack: multi-source single-flight solidjs/templates#287), which is the point: none of it is Start-specific.
  • Complementary to #8192 (named single-flight sources + loadFlightTarget): this PR is the SSR/read side going native, that one is the mutation/write side. Together they remove the need for any *-ssr-query package on Solid.
  • docs/router/integrations/query.md's Solid tab still shows the old setup — happy to rewrite it once there's agreement on direction.
  • React/Vue packages untouched; the router-ssr-query-core transport remains correct for frameworks without a native serialization channel.

Made with Cursor

…els carry the Router + Query pairing

solid-query v6's QueryClientProvider serializes the request's cache into
Solid's hydration registry during SSR and primes the client cache from
it, so running the ssr-query transport alongside it ships every query
payload twice. The package's two runtime conveniences are each a few
lines of userland composition on public APIs: the provider wrap via the
router's Wrap option, and cache-driven redirect() errors handed to
router.navigate from the caches' config.onError.

Converts the three Solid Start e2e apps to the composition (all suites
green, including the redirect-from-query tests) and marks the package
deprecated for the v2 line.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

@nx-cloud

nx-cloud Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 74435de

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 11m 48s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 2m 13s View ↗

☁️ Nx Cloud last updated this comment at 2026-08-29 21:13:19 UTC

@pkg-pr-new

pkg-pr-new Bot commented Aug 29, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@8193

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@8193

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@8193

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@8193

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@8193

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@8193

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@8193

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@8193

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@8193

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@8193

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@8193

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@8193

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@8193

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@8193

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@8193

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@8193

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@8193

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@8193

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@8193

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@8193

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@8193

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@8193

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@8193

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@8193

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@8193

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@8193

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@8193

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@8193

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@8193

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@8193

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@8193

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@8193

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@8193

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@8193

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@8193

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@8193

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@8193

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@8193

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@8193

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@8193

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@8193

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@8193

commit: 74435de

@brenelz

brenelz commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

I'm on board with this. Would be one less package to maintain.

Running the package alongside it ships every query payload twice

That doesn't seem ideal

@codspeed-hq

codspeed-hq Bot commented Aug 29, 2026

Copy link
Copy Markdown

Hooray! CodSpeed harness just leveled up!

The base and head of this comparison were measured with different runner settings, so their benchmark values are not directly comparable.

What changed between base and head:

Re-run the base with the same settings to get a valid performance comparison.


Comparing ryansolid:feat/solid-native-query-ssr (74435de) with solid-router-v2-pre (67a9040)1

Open in CodSpeed

Footnotes

  1. No successful run was found on solid-router-v2-pre (5010e89) during the generation of this report, so 67a9040 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants