-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Summary
HtmlRewriterAdapter accumulates the entire HTML document before processing, despite lol_html supporting incremental write() calls. Rewrite to emit output on every process_chunk() call.
Changes
- Create rewriter eagerly in constructor with
Rc<RefCell<Vec<u8>>>shared output sink vialol_html::OutputSinktrait process_chunk()drains buffer after eachrewriter.write()— emits output per chunk- Adapter becomes single-use:
reset()is a no-op (Settings consumed by constructor) - Update existing tests that assert empty intermediate output
- Add test proving per-chunk output emission
File: crates/trusted-server-core/src/streaming_processor.rs:396-472
Note: HtmlWithPostProcessing wraps this adapter and passes through intermediate output for !is_last chunks. No changes needed to html_processor.rs.
Plan
See docs/superpowers/plans/2026-03-25-streaming-response.md — Task 4
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels