Skip to content

SSR and hydration support for @tanstack/solid-db #1964

Description

@KyleAMathews

Follow-up to #1623 (Phase 6). #1564 added the shared DbClient and hydration payload, but the SSR guide leaves Solid client-provider work for a later change.

Goal

Render Solid live queries on the server from a request-scoped DbClient, then hydrate their result in the browser without an empty/loading flash or cross-request state leakage. Preserve Solid-native signals, resources, and keyed reactivity.

Acceptance criteria

  • Provide an idiomatic Solid client context/provider so useLiveQuery can resolve collection descriptors against the current DbClient. Direct collection inputs and existing non-SSR usage remain supported.
  • A server request can create its own client, preload a collection or live query, render the expected rows, and serialize dbClient.dehydrate(). Concurrent requests do not share collection/query state.
  • A browser client consumes the server state before its first query read. The initial hydrated output matches the server; subsequent normal sync replaces it without duplicate rows or stale resource results.
  • Add an integration or E2E test through a real Solid server-render/hydration path, including request isolation and a post-hydration update.
  • Document setup and any unsupported query/resource cases.

Reuse the core SSR snapshot/observer contract rather than introducing a Solid-specific payload.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions