Parent: #563
Summary
`NextJsNextDataRewriter` assumes it receives complete text node content in a single `rewrite()` call. Under the streaming `HtmlRewriterAdapter`, lol_html may split text nodes across chunk boundaries, causing silent missed rewrites on large `NEXT_DATA` payloads.
Changes
- Accumulate text fragments in `NextJsNextDataRewriter` until `TextChunk::last_in_text_node()` is true
- Only perform the rewrite on the complete accumulated text
- Add regression test with small chunk size that splits a `NEXT_DATA` payload mid-string
File: `crates/trusted-server-core/src/integrations/nextjs/script_rewriter.rs`
Plan
See `docs/superpowers/specs/2026-03-25-streaming-response-design.md` — Phase 3