Server Rendering for Queries?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6.5k
- Forks
- 456
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 5
Description
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?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the ShareDB Query lifecycle and the internal Queries._ingestSnapshots method mentioned in the issue, comparing server-side execution with client-side subscription. Determine whether the existing API can accept server-rendered results and define what public API or hydration behavior would be needed to avoid a second query while preserving updates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100