turborepo
ffb7e70a - Implement Streaming Static/Proxy Rendering (#4329)

Commit
2 years ago
Implement Streaming Static/Proxy Rendering (#4329) ### Description Implements streaming rendering for static/proxy renders (I don't know why they're called static or proxy…) using an initial `Headers` message, N `BodyChunk` messages, and a final `BodyEnd` message. Updating proxy rendering was very easy. It already implemented separate messages for header and body, but it buffered the full body before sending the full contents. But static rendering was a little more difficult, it has multiple paths that are immediately ready with a full body that I didn't want to break apart. So I kept the `Response` message for a full response that transforms into a `ContentSourceContent::Static`, and implemented a new enum type for streaming responses into a `ContentSourceContent::HttpProxy`. These is some weirdness with different data types on the `headers` field of a `ContentSourceContent::Static`'s `StaticContent` and a `ContentSourceContent::HttpProxy`'s `ProxyResultVc`. One is a `HeaderListVc` and the other is a `Vec<(String, String)>` (and really should be a `HeadersList`), but I'm leaving this for a follow up. ### Testing Instructions Paired Next.js PR: https://github.com/vercel/next.js/pull/47476 Re: WEB-27
Author
Parents
Loading