Closed a-h closed 1 week ago
The ComponentHandler
that's used for HTTP currently renders everything to an internal buffer, so that if there's an error during template rendering, the correct HTTP status code can be used.
So, there is likely a need for a streaming version of the Handler
function, e.g. StreamingHandler
which doesn't do that, or a streaming mode of operation for the existing version.
This makes sense to me, it took a minute for me to understand what the point was, but I get it now.
I think this needs thorough docs, not just around how to use it, but when and why you would use it with examples.
You read my mind on the non-flushable streams error, I was going to ask about that.
Fixes #207 Resolves https://github.com/a-h/templ/discussions/458
See https://github.com/a-h/templ/discussions/781#discussioncomment-9680731 for discussion