Skip to content

refactor: use runtime xhtmlDocument() for the XHTML shell - #63

Merged
atherdon merged 1 commit into
mainfrom
refactor/postmark-xhtml-document
Oct 29, 2026
Merged

atherdon merged 1 commit into
mainfrom
refactor/postmark-xhtml-document

Conversation

@atherdon

@atherdon atherdon commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Rebuild of this PR on current main. Uses the latest published @llazyemail/template-runtime-display@1.2.1 and routes the Postmark document shell through runtime xhtmlDocument().

Supersedes #58 and #61 (their stacked document() / slot work is folded into this single-purpose change).

Changes

  • Bump @llazyemail/template-runtime-display 0.9.0 → 1.2.1 (includes xhtmlDocument()).
  • renderPostmarkDocument calls xhtmlDocument({ headHtml, preheaderHtml, mainHtml }).
  • Postmark shell (masthead / body / footer row) stays in mainHtml; footer stays inside the shell table on purpose (runtime footerHtml would land outside .email-content and change layout).
  • Delete postmarkBody.ts; drop unused body / BodyProps re-exports from blocks.ts.

Runtime fit

xhtmlDocument() fits Postmark’s shell: XHTML 1.0 Transitional doctype, xmlns="http://www.w3.org/1999/xhtml", no lang. No extra html/body attributes were needed, so document() with a manual XHTML doctype was not required.

Output vs main

Semantically equivalent (whitespace-normalized HTML matches). Byte-level diffs are whitespace only:

  • no leading indent before <head> / <body> (runtime shell owns those tags)
  • trailing spaces after the preheader span that the old helper inserted are gone

Dependency / auth

main already has #65 (.npmrc + workflow NODE_AUTH_TOKEN for GitHub Packages). No further npmrc changes in this PR.

Test plan

  • npm run lint
  • npm test (147)
  • npm run test:real-data (21)
  • npm run generate:template -- --all + npm run generate:assert
  • CI green on this PR

@atherdon
atherdon force-pushed the refactor/postmark-xhtml-document branch from bdeadf6 to bfbfe10 Compare October 29, 2026 17:50
@atherdon
atherdon changed the base branch from refactor/postmark-document-slots to main October 29, 2026 17:50
@atherdon
atherdon force-pushed the refactor/postmark-xhtml-document branch from bfbfe10 to 98aac67 Compare October 29, 2026 17:54
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Rendered emails

This PR rendered email templates.

Open the run → Artifacts → download → open index.html.

Bump @llazyemail/template-runtime-display to 1.2.1 and route the Postmark
document through xhtmlDocument() (XHTML doctype, xmlns, no lang). Preheader
uses the preheaderHtml slot; the Postmark shell stays mainHtml with the
footer inside the shell table. Drop the unused postmarkBody helper.

Co-authored-by: petroved <arthur.tkachenko.netweight@gmail.com>
@atherdon
atherdon force-pushed the refactor/postmark-xhtml-document branch from 98aac67 to 81644b1 Compare October 29, 2026 17:56
@atherdon
atherdon marked this pull request as ready for review October 29, 2026 18:06
@atherdon
atherdon merged commit ce78cde into main Oct 29, 2026
3 checks passed
@atherdon
atherdon deleted the refactor/postmark-xhtml-document branch October 29, 2026 18:06
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