GitShow/developit/vhtml
developit

vhtml

Render JSX/Hyperscript to HTML strings, without VDOM ๐ŸŒˆ

by developit
html-stringhyperscriptjsxpreactvdomvirtual-dom
Star on GitHubForkWebsitenpm

JavaScript

814 stars37 forks6 contributorsQuiet ยท 2y agoSince 20162.2.0MIT

Meet the team

See all 6 on GitHub โ†’
developit
developit13 contributions
NekR
NekR2 contributions
nathancahill
nathancahill2 contributions
ithinkihaveacat
ithinkihaveacat1 contribution
pl12133
pl121331 contribution
keyserfaty
keyserfaty1 contribution

Languages

View on GitHub โ†’
JavaScript100%

Commit activity

Last 12 weeks ยท 0 commits

Full graph โ†’

Community health

2 of 6 standards met

Community profile โ†’
42
โœ“READMEโœ“Licenseโ—‹Contributingโ—‹Code of Conductโ—‹Issue Templateโ—‹PR Template

Recent PRs & issues

Quiet ยท Last activity 2y ago
See all on GitHub โ†’
wongchichong
convert to typescript, add comment tag, text nodeOpenPR

Here are the follow changes: convert code to typescript add comment tag '!' to h( ) add textnode tag 'text' to h() generate .d.ts, and un-minify source from tsc generate minified source from esbuild+vite vite config: vite.config.ts esbuild for mocha in .esbuildrc.js remove babel & rollup add svg test case

wongchichong ยท 5mo ago
odinhb
MaintenanceOpenIssue

Hey everyone Since we use this project and the maintainer did not respond for a while I went ahead and forked this project here. (npm) I've incorporated various fixes/ideas from issues and pull requests to vhtml while rewriting the code for readability, adding more tests and a benchmark. I also tried to improve the documentation according to some questions/concerns that have been raised here on vhtml. Feel free to send pull requests or create issues over there, and we will do our best to respond to them. Keep in mind that the fork intentionally makes a few breaking changes, which is also why I bumped the major version number.

odinhb ยท 6mo ago
Shenmin-Z
SSR Memory leakOpenIssue

I recently added this package in our project and I was told it's causing memory leak in our prod env. After reading the code, it seems like it's the cache that's causing the problem. Every generated html string() would be stored in this cache, and it seems to have caused our server run out of memory and keeps restarting.

Shenmin-Z ยท 8mo ago

Recent fixes

View closed PRs โ†’
johannesodland
Switch to WeakMap and String objects to avoid memory leak. Fixes #20 and #34.MergedPR

Adding a new PR here to start the discussion on solving #20 again. PR https://github.com/developit/vhtml/pull/23 aims to solve #20 by switching to WeakMap, but it uses string primitives as keys and will throw . PR https://github.com/developit/vhtml/pull/36 switches to a Set for storing the sanitized strings, but we risk evicting strings from the set before using them, changing the output of to escaped text. This PR switches to WeakMap (as in https://github.com/developit/vhtml/pull/23), but uses string objects as keys. This will have a performance impact, and change the output from from string primitives to string objects. The question is if it's worth taking the performance impact to solve both #20 and #34.

johannesodland ยท 8mo ago
jcubic
Doesn't render 0ClosedIssue

JSX should only ignore boolean, null and undefined. But it doesn't render 0: Modified example of numbers: The first item is not rendered. https://jsfiddle.net/ts0Lhcfq/

jcubic ยท 2y ago
jcubic
Is pragmaFrag supported?ClosedIssue

I'm trying to use a fragment but got error from babel: transform-react-jsx: pragma has been set but pragmaFrag has not been set I'm using Codepen. Here is my code https://codepen.io/jcubic/pen/jOJbOwG

jcubic ยท 2y ago
Structured data for AI agents

Repository: developit/vhtml. Description: Render JSX/Hyperscript to HTML strings, without VDOM ๐ŸŒˆ Stars: 814, Forks: 37. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Homepage: http://npm.im/vhtml Topics: html-string, hyperscript, jsx, preact, vdom, virtual-dom. Latest release: 2.2.0 (6y ago). Open PRs: 14, open issues: 11. Last activity: 2y ago. Community health: 42%. Top contributors: developit, NekR, nathancahill, ithinkihaveacat, pl12133, keyserfaty.

ยท@ofershap

Replace github.com with gitshow.dev