Skip to main content

prerender_stream

Function prerender_stream 

Source
pub fn prerender_stream(
    value: &Value,
    ctx: &BlockRenderCtx<'_>,
) -> Result<String, BlockError>
Expand description

Walk a JSON array of {type, id, value} entries and concatenate each block’s Block::render output.

Unknown / unregistered type values emit a minimal <div class="rcms-stream-drift"> chrome carrying the unknown type name — authors see exactly what’s orphaned + can remove it via the editor. This matches the schema-drift “yellow banner” UX from the plan (stream_block.py:235-287 filters silently; we render visibly).

A block that fails to render — a template error, a bad value — leaves a hidden rcms-stream-error marker naming its type and is logged; the rest of the stream still renders. It used to fail the whole stream, and the page then rendered with its body missing.

§Errors

Non-array input returns a shape error.