Tagged template string virtual DOM builder that replaces JSX with standard ES6 template literals. Current stable version: 3.0.1 (released 2020). Hyperx is unmaintained as of 2023; last commit was in 2020. It works with virtual-dom, React, hyperscript, or any hyperscript-style API (h(tagName, attrs, children)). Key differentiators: no transpiler needed for modern browsers/Node 4+, supports inline <style> parsing, optional self-closing tag handling, and createFragment option for React fragments. Compared to JSX, hyperx avoids a build step but may be slower due to runtime parsing.
npm install hyperxNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creating a simple virtual DOM tree with hyperx and virtual-dom, demonstrating variables and mapping arrays.
Consider using the hyperxify browserify transform to statically compile templates.
Use React.createElement.apply(null, [component, properties].concat(children)) as the h function.
Check the DOM builder's documentation for how it handles function attributes.
Test templates that include CSS selectors with > or self-closing tags; update as needed.
Evaluate alternatives like lit-html for actively maintained template-based DOM builders.
Use `const hyperx = require('hyperx')` or `import hyperx from 'hyperx'`.Make sure to pass a valid h function, e.g., `var h = require('virtual-dom').h; var hx = hyperx(h)`.Use the createFragment option or a custom createElement that spreads children: `React.createElement.apply(null, [component, properties].concat(children))`.
Ensure your environment supports ES6 tagged templates. For older targets, use hyperxify to precompile.