Skip to content

hydration #4691

@TkDodo

Description

@TkDodo

Hydration implementation details (major)
Step 1: Should still happen in render for new queries (and queries with no observers?), but be scheduled for a useEffect for queries that someone is actively listening to since this results in re-renders/observable side effects
Step 2 (optional): When hydrating in useEffect also add the new data to a context for that subtree, refactor all reads to patch in data from that context. That subtree safely gets the new data during the same render instead of after, "true" cache and thus anything listening outside of that subtree gets updated via the useEffect (This might be overkill, we should evaluate if step 1 is good enough first)

@Ephem

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions