Last 12 weeks · 0 commits
2 of 6 standards met
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
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.
Repository: developit/vhtml. Description: Render JSX/Hyperscript to HTML strings, without VDOM 🌈 Stars: 813, 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: 1y ago. Community health: 42%. Top contributors: developit, NekR, nathancahill, ithinkihaveacat, pl12133, keyserfaty.
JavaScript
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.
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.