Skip to content

feat(ui-server): renderPage API for zero-boilerplate SSR #414

@vertz-tech-lead

Description

@vertz-tech-lead

Problem

SSR currently requires developers to manually construct the HTML shell — doctype, head, meta tags, OG tags, scripts, styles. This is boilerplate that should be handled by the framework.

See the current Cloudflare example (examples/ssr-cloudflare/src/app.ts) — 50+ lines of raw HTML string.

Solution

renderPage(component, options?) in @vertz/ui-server that returns a complete Response:

renderPage(App, {
  title: 'My App',
  og: { image: '/og.png' },
  scripts: ['/app.js'],
})

Two-layer API:

  • renderPage → returns Response (90% of cases)
  • renderToStream → returns ReadableStream (escape hatch for custom headers)

Design Doc

See plans/render-page.md

Blocks

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Critical — launch blockers, securityenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions