feat: add the streaming demo app (BON-5) - #40
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
Limit details: You’ve used the included review currently available. 📝 WalkthroughWalkthroughAdds a ChangesStreaming demo
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This adds a localized streaming demo with documented browser and curl validation; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Client
participant HonoApp
participant RegionLoader
Client->>HonoApp: GET /
HonoApp->>RegionLoader: load(region, speed, fail)
RegionLoader-->>HonoApp: Region content or error
HonoApp-->>Client: Streamed HTML chunks
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Usage-based review receipt
Note This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. Track spend and usage in your billing settings. 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. Comment |
A live demo of the streaming kit:
apps/stream, a Hono app whose view-source is the wire protocol verbatim. Three throttled regions (profile 500ms, stats 1500ms measured, feed 3000ms) complete out of DOM order;?speed=scales the latencies and?fail=<region>exercises the error chunk. The element module and stylesheets are served straight from the workspace build, and the server file runs under Node's native TypeScript, with no bundler, so nothing transforms the streamed output.Run it with
vp run stream, then watch the bytes withcurl --no-buffer localhost:3000.Manual validation
Checked with headless Chromium (Playwright, from the local cache) and
curl; Firefox wasn't exercised, only Chromium's behavior is confirmed here.curl --no-buffer localhost:3000/returns the shell at ~36ms (2141 bytes), then three chunks with real gaps between them: profile ~533ms, stats ~1534ms, feed last at ~3032ms, matching its 3000ms latency./: all three boundaries showaria-busyand CSS skeleton bars at 200ms, then final content with noaria-busyby 4s.async(f247e27) to engage mid-stream. Without it, a streaming response never closes its tags until the stream ends, so<script type="module">waits for the parse to finish andcustomElements.get('bones-boundary')stayed undefined until the feed chunk landed at ~3040ms. Withasync, the element defines at ~100ms, right after the module fetch.[part~="bone"]measured bars from ~100ms while busy; they clear in the same 40ms poll asaria-busygoing away, at ~1553ms, against a curl chunk arrival of ~1534ms. Profile and feed clear at ~537ms and ~3059ms, tracking their own chunk arrivals./?speed=0: polledaria-busyevery 50ms for the first second (19 samples), it never read true on any boundary, content was present on the first sample./?fail=stats: by ~3.5s the stats boundary carriesdata-bones-errorand shows "stats failed: the stats endpoint failed" in a red-outlined box; profile and feed stream their real content normally alongside it.reducedMotion: 'reduce'): all three boundaries resolve to full content, no crossfade.speed=0,fail=stats, reduced motion, and the pre/post-fix timing checks.Part of BON-5 (PR 3 of 3).
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Tests
Chores