Skip to content

refactor: split the renderer and install render-template - #19

Merged
atherdon merged 1 commit into
mainfrom
split/runtime-render
Oct 3, 2026
Merged

atherdon merged 1 commit into
mainfrom
split/runtime-render

Conversation

@atherdon

@atherdon atherdon commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Why

src/runtime/render.ts held the public renderer, the supporting API, and the internal helpers. The shared renderer now lives in @llazyemail/render-template.

What

  • Depend on @llazyemail/render-template at 0.1.2. That tag runs prepare, so a git install builds dist before packing.
  • src/runtime/renderTemplate.ts is the public renderTemplate method. It validates, runs each part, collects a trace, calls compose, and returns a RenderResult.
  • src/runtime/api.ts holds defineTemplate, renderMany, slot, hasSlot, and RenderError.
  • src/runtime/helpers.ts holds finish, createContext, assertTemplate, assertPart, normalizeHtml, okTrace, skippedTrace, describeError, and publish.
  • src/runtime/render.ts re-exports the public API, so existing imports stay the same.

Public signatures, RenderError, and rendered output are unchanged. npm test (45) and npm run typecheck pass.

Install @llazyemail/render-template for RenderError and the shared error type. Move renderTemplate, the supporting public API, and the internal helpers into separate files without changing signatures or output.
@atherdon atherdon mentioned this pull request Oct 3, 2026
4 of 7 tasks
@atherdon
atherdon merged commit be92029 into main Oct 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant