Skip to content

Design lazy renderer preload for streaming SSR #210

Description

@woksin

Problem

Renderer slot entries are synchronous in Components 4. preloadRenderer and lazy slot entries were deliberately deferred because streaming SSR and hydration determinism were not proven. Inventing a load contract without a real stream fixture would create an unstable cache/protocol surface.

Direction

Design lazy renderer loading around a real streaming SSR consumer:

  • preload resolves lazy entries into a synchronous request-local cache before renderToPipeableStream;
  • server serializes renderer/profile identity and the client verifies the same identity before hydration;
  • concurrent requests cannot share mutable renderer state;
  • rejected/aborted loads, missing chunks, CSP, timeout, retry, and fallback semantics are explicit;
  • zero-config and eager adapters pay no runtime/bundle penalty.

Acceptance criteria

  • A documented streaming SSR fixture preloads, streams, and hydrates with zero structural diff.
  • Concurrent requests selecting different renderers remain isolated.
  • Missing/rejected loads fail with one actionable Core-owned diagnostic.
  • Client/server renderer-id mismatch fails before corrupt hydration.
  • The eager path and setup-only root remain unchanged.
  • Only then are lazy slot entries and preload APIs eligible for promotion.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions