Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
hyperhtml
Advanced tools
Please ask questions in the dedicated discussions repository, to help the community around this project grow ♥
A Fast & Light Virtual DOM Alternative.
Following an overview of projects related, or inspired by, hyperHTML. For a deep comparison of current libraries, feel free to check this gist out.
The latest, smallest, iteration of all best concept from this library since 2017, have been packaged in ~2.5K. If it's extreme minimalism and great DX that you are after, check uhtml out.
If you've just started with template literals based projects and you like components, or you'd like to understand what's hyperHTML capable of, give hypersimple a try 🎉
This little brother is "showing off" these days, claiming better performance and unprecedented ease of use.
If you like React hooks concept, don't miss this little wrap that adds 0.something overhead to the already lightweight hyperHTML, bringing in very similar concepts.
If you also like React hooks mechanism and you'd like to combine these via hyperHTML or HyperHTMLElement, try haunted out!
You can require or import hyperHTML with any bundler and in different ways.
If requiring or importing from "hyperhtml"
doesn't work, try requiring from "hyperhtml/cjs"
for CommonJS friendly bundlers (WebPack), or "hyperhtml/esm"
for ESM compatible bundlers (Rollup).
See HELPERS.md for a list of additional tools which can be helpful for building hyperHTML based web applications.
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]
Thank you to all our backers! 🙏 [Become a backer]
This project exists thanks to all the people who contribute. [Contribute].
?boolean=${value}
syntax from µhtml has landed in hyperHTML too. Feel free to rea this long discussion to better understand why this syntax is necessary.<self-closing />
tags for both custom elements and any other as well 🎉Following most important changes in version 2:
hyperHTML
variable.escape
and .adopt
, either useless or unstable. hyperHTML.adopt
will be implemented as module a partstyle
attribute, fully compatible with Preact implementationdocument.importNode
and/or regular cloneNode
tested against common polyfillsA proper documentation full of examples can be found in viperhtml.js.org.
The easiest way to describe hyperHTML
is through an example.
// this is hyperHTML
function tick(render) {
render`
<div>
<h1>Hello, world!</h1>
<h2>It is ${new Date().toLocaleTimeString()}.</h2>
</div>
`;
}
setInterval(tick, 1000,
hyperHTML(document.getElementById('root'))
);
IE9+ , iOS8+ , Android 4+ and every modern Mobile or Desktop Browser. You can verify directly through the following links:
'@ungap/weakmap': object is not extensible
Babel freezes the template literals by spec but that causes problems with the weakmap polyfill. To fix this error add the fix explained on ungap/weakmap
If you are using Visual Studio Code you can install literally-html
to highlight all literals handled by hyperHTML
and others.
If you'd like to make your templates prettier than usual, don't miss this plugin: https://github.com/sgtpep/prettier-plugin-html-template-literals
Please ask anything you'd like to know in StackOverflow using the tag hyperhtml
so that others can benefit from answers and examples.
You can read more on this hyperHTML vs lit-html comparison.
npm install hyperhtml
If your bundler does not work with the following:
// ES6
import hyperHTML from 'hyperhtml';
// CJS
const hyperHTML = require('hyperhtml');
You can try any of these other options.
import hyperHTML from 'hyperhtml/esm';
// or
import {hyper, wire, bind, Component} from 'hyperhtml/esm';
// or
import hyperHTML from 'https://unpkg.com/hyperhtml?module';
const hyperHTML = require('hyperhtml/cjs').default;
// or
const {hyper, wire, bind, Component} = require('hyperhtml/cjs');
In alternative, there is a pre-bundled require("hyperhtml/umd")
or via unpkg as UMD module.
FAQs
A Fast & Light Virtual DOM Alternative
We found that hyperhtml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.