Skip to content

fix: await full SSR stream so first-byte HTML contains page content#159

Merged
rsbh merged 1 commit into
mainfrom
fix/ssr-await-stream-all-ready
Jul 9, 2026
Merged

fix: await full SSR stream so first-byte HTML contains page content#159
rsbh merged 1 commit into
mainfrom
fix/ssr-await-stream-all-ready

Conversation

@rsbh

@rsbh rsbh commented Jul 9, 2026

Copy link
Copy Markdown
Member

Problem

On first load, the SSR response only guaranteed the React shell in the first flush. All page components are lazy() behind a <Suspense> boundary in App.tsx, so the initial HTML contained the PageFallback skeleton while real content streamed in later chunks — a skeleton flash on first paint, and crawlers/tools that don't process streamed chunks could see only the skeleton.

Fix

Await stream.allReady before returning the response in entry-server.tsx. The complete document now ships in a single response, so page content is present from the first byte.

This is the pattern React documents for crawlers and static generation: Waiting for all content to load for crawlers and static generation.

Trade-off

Loses streaming TTFB (fine for docs pages — content is already resolved synchronously on the server). React still emits the Suspense fallback markup with an inline swap script, but since everything arrives at once, the swap happens during HTML parse with no visible skeleton.

Verified

Ran bun run dev:examples:basic and curled /docs — full rendered content (<h1>Welcome</h1>, body headings) present in the response HTML.

🤖 Generated with Claude Code

renderToReadableStream resolves when only the shell is ready, so the
first flush contained just the Suspense skeleton fallback while real
content streamed in later chunks. Await stream.allReady before
responding so the complete document ships in a single response.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chronicle Ready Ready Preview, Comment Jul 9, 2026 8:09am

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@rsbh, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9c00cbce-693b-4d66-812b-5ec7b832d6a4

📥 Commits

Reviewing files that changed from the base of the PR and between f1c3a05 and f7b2a55.

📒 Files selected for processing (1)
  • packages/chronicle/src/server/entry-server.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ssr-await-stream-all-ready

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rsbh rsbh requested a review from rohanchkrabrty July 9, 2026 08:11
@rsbh rsbh merged commit cc7882b into main Jul 9, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants