variable / @typed/template/Html

StaticHtmlRenderTemplate

A variant of HtmlRenderTemplate that enables static rendering optimizations.

This layer provides the RenderTemplate service for HTML generation but also sets StaticRendering to true, enabling optimizations for static content.

Package version
1.0.0-beta.7
Category
Static HTML rendering
Since
1.0.0

Import

import { StaticHtmlRenderTemplate } from "@typed/template/Html";

Signatures

export declare const StaticHtmlRenderTemplate: Layer.Layer<RenderTemplate, never, never>;

Why

Static output omits hydration markers when no client adoption contract is needed, while retaining the same escaping and ordering rules.

Ownership and lifetime

Like HtmlRenderTemplate, service caches are Layer-scoped and each render is finalized by the Scope running its Fx.

Examples

import { StaticHtmlRenderTemplate } from "@typed/template/Html"
import { html } from "@typed/template"
import { renderToHtmlString } from "@typed/template/Html"
import { Effect } from "effect"

const output = Effect.runPromise(Effect.scoped(
  renderToHtmlString(html`<p>ready</p>`).pipe(
    Effect.provide(StaticHtmlRenderTemplate)
  )
))

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source