RenderResult
The output of {@see \Milpa\Live\Contracts\Rendering\ComponentRendererInterface::render()}. `$state` MUST be populated whenever the renderer mounted the component itself (see {@see RenderRequest::$state}), so callers that need to persist or re-encode the resulting state do not have to re-mount to get it. Two asset channels coexist on purpose: `$assets` is the legacy, string-keyed, target-specific bag (`'script'` URL, TUI key hints) that compilers merge with `array_merge`; {@see clientAssets()} is the typed convention of greenhouse decisions/0211 — the URLs a renderer implementing {@see \Milpa\Live\Contracts\Rendering\DeclaresClientAssets} declared, which compilers merge with {@see ClientAssets::merge()} (deduplicated by URL) and the host emits once.
RenderResult::__construct()
public function __construct(string $output, ?Milpa\Live\ValueObjects\StateSnapshot $state = null, array $assets = [], array $effects = [], Milpa\Live\ValueObjects\RenderTarget $format = Milpa\Live\ValueObjects\RenderTarget::HTML, ?Milpa\Live\ValueObjects\ClientAssets $clientAssets = null):Parameters
| Name | Type | Description |
|---|---|---|
| $output | string | The rendered output — HTML markup, or a TUI text block, per `$format`. |
| $state | (StateSnapshot | null) | The state that was rendered, populated whenever the renderer mounted or otherwise resolved one. |
| $assets | array<string, mixed> | Target-specific client assets/metadata (e.g. `'script'` URL, TUI key hints). |
| $effects | array<int, array<string, mixed>> | Side effects the caller should apply alongside the output. |
| $format | RenderTarget | Which target this output was rendered for. |
| $clientAssets | (ClientAssets | null) | The declared client files this output depends on, or null for none. |
RenderResult::clientAssets()
public function clientAssets(): Milpa\Live\ValueObjects\ClientAssetsThe declared client files this output depends on — scripts and stylesheets the host page must load once. Empty when the renderer declared none.