From 1d9fe56dc91b1991d25dfad97ec13a8a2467c6e3 Mon Sep 17 00:00:00 2001 From: ChristopherPHolder Date: Sat, 28 Nov 2026 14:46:23 +0100 Subject: [PATCH] docs: the stepped response shows two parts arriving out of order and hydrating one at a time, on the home page too The figure that steps through one page load had a single slow part, so it could not show what out of order means, and it only sat halfway down the Introduction. It now uses the product page from "Why stream out of order": the recommendations sit above the reviews, which arrive first (1 s, then 3 s). Seven steps, Back and Next: the shell goes out and hydrates, the reviews' chunk arrives before the recommendations' and hydrates by itself while the recommendations are still a placeholder, then the recommendations arrive, the response ends, and they hydrate. Each part in the drawing names its block id, and the response shows d1's chunk before d0's, with `p` listing what is still on its way. The docs home page shows it under "What angular-ssr-stream does", where the demo's landing page used to, and "Why stream out of order" links to it. Closes #116 --- apps/docs/src/app/figures/response-player.ts | 122 +++++++++++++----- apps/docs/src/app/home.ts | 8 +- apps/docs/src/content/concepts/walkthrough.md | 4 +- .../concepts/why-stream-out-of-order.md | 6 +- .../content/getting-started/introduction.md | 5 +- 5 files changed, 109 insertions(+), 36 deletions(-) diff --git a/apps/docs/src/app/figures/response-player.ts b/apps/docs/src/app/figures/response-player.ts index afb23ce..5da2832 100644 --- a/apps/docs/src/app/figures/response-player.ts +++ b/apps/docs/src/app/figures/response-player.ts @@ -4,6 +4,9 @@ import { CodeSample, type Sample } from './code-sample'; /** Who owns a piece of the drawn page at a step. */ type Owner = 'server' | 'hydrated'; +/** A slow part of the page: its placeholder until its chunk arrives. */ +type BlockState = 'placeholder' | Owner; + interface Step { /** The label on the step's button. */ short: string; @@ -13,31 +16,49 @@ interface Step { sent: number; /** Null until the shell has arrived. */ shell: Owner | null; - reviews: 'placeholder' | Owner; + recommendations: BlockState; + reviews: BlockState; } -/** The response, in the two pieces the server writes. Cut down to what does the work. */ +/** + * The response, in the three pieces the server writes. Cut down to what does + * the work. The recommendations sit above the reviews, so they are met first + * and get `d0`; the reviews are `d1`, and arrive first. + */ const PIECES = [ `

Trail shoes

-

Loading reviews…

+

Loading recommendations…

- +
+

Loading reviews…

+ +
+ `, - `