Skip to content

Document async-htm-to-string as a Preact-free rendering option#247

Open
bcomnes wants to merge 4 commits intomasterfrom
docs/async-htm-to-string
Open

Document async-htm-to-string as a Preact-free rendering option#247
bcomnes wants to merge 4 commits intomasterfrom
docs/async-htm-to-string

Conversation

@bcomnes
Copy link
Copy Markdown
Owner

@bcomnes bcomnes commented Apr 18, 2026

Closes #239

DomStack works with async-htm-to-string out of the box but there is no documentation pointing users to it. Sites that only do server-side rendering and have no client-side Preact components gain nothing from the Preact dependency and async-htm-to-string is a natural fit, using the same htm tagged template syntax.

This adds a "Using async-htm-to-string for string-based rendering" subsection at the end of the TypeScript Support section covering:

  • How it differs from htm/preact (attribute names, no separate renderToString call)
  • Three gotchas users hit: standard HTML attribute names (not React aliases), the requirement to await the html tag, and the XSS risk of rawHtml()
  • A short example showing a layout using rawHtml() for trusted inner content

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds documentation for using async-htm-to-string as a Preact-free option for server-side HTML rendering in DomStack, addressing #239.

Changes:

  • Documented async-htm-to-string as a string-rendering alternative to htm/preact + preact-render-to-string
  • Included examples and highlighted key behavioral differences and gotchas (attribute naming, await usage, rawHtml() XSS risk)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
Comment thread README.md Outdated
Comment thread README.md Outdated
…n, rawHtml nuance

- Add npm install snippet to make the section actionable
- Clarify the await behavior: the tag returns an object that resolves
  asynchronously; describe the actual failure mode rather than just
  saying 'thenable'
- Soften the 'trusted' claim for children: note that children can be
  any type from a page function and may contain unsanitized content
  depending on the page source
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 18, 2026

Coverage Report for CI Build 24619423904

Coverage remained the same at 91.469%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4070
Covered Lines: 3804
Line Coverage: 93.46%
Relevant Branches: 642
Covered Branches: 506
Branch Coverage: 78.82%
Branches in Coverage %: Yes
Coverage Strength: 73.63 hits per line

💛 - Coveralls

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread README.md
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
…wait and { pages })

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

Document async-htm-to-string as a first-class Preact-free templating option

3 participants