Skip to content

feat: progressive soft-nav streaming in the client router (follow-up to #469) #473

Description

@vivek7405

Follow-up to #469 (PR #470), depends on the <webjs-suspense> streaming follow-up. Today a soft navigation BUFFERS the response: router-client.js does const text = await resp.text() before applying template[data-webjs-resolve] boundaries, so resp.text() waits for the ENTIRE stream (including the slow boundary) before swapping. Soft nav therefore gives the correct final content but NOT progressive fallback-then-stream.

Scope

Apply a streamed response PROGRESSIVELY on soft nav.

  • Replace the resp.text() buffer (around router-client.js:1501) with a getReader() read.
  • Swap the layout children to show the fallbacks immediately, then resolve each data-webjs-resolve boundary as it streams in (around router-client.js:2830).
  • Keep the URL advance (already correct) and scroll restoration.

Acceptance

  • An e2e test: clicking a link advances the URL AND streams the new route's components progressively (fallbacks first, fast-before-slow), not a buffered all-at-once swap.
  • A failed/partial stream recovers in place (no destructive reload), matching the existing navigation-error behavior.

Activity

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions