Skip to content

Server Rendering for Queries? #501

@curran

Description

@curran

Greetings,

Is it possible to execute a ShareDB Query server-side, then pass the results data into the client via server rendering and use that to data hydrate a client-side ShareDB query?

Use case: a page that lists a number of ShareDB documents, where server rendering is in play.

Desired behavior: the query runs against the database once during server rendering, then in the client side the same query can be instantiated with results from the first execution, then subscribed for updates without triggering the query to be executed again.

I notice there is an internal method on Queries called _ingestSnapshots. This seems useful for the task at hand.

Is it possible to leverage that method? Might it be possible to expose that method as part of the public API?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions