This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

compact-dom

0.4.1 • Public • Published

compact-dom

Compact-DOM is a programmer-friendly way to represent a DOM tree in Javascript. The following example shows how it looks and how it compares to plain HTML.

Compact-DOM:

h.div(
  h.input({type: "text", value: you, oninput: handleNameInput}),
  h.p.output("Hello " + you)
)

HTML:

<div>
  <input type="text" value="{{you}}" oninput="handleNameInput()" />
  <p class="output">Hello {{you}}</p>
</div>

Use

Compact-DOM does not run natively in browsers, at least not until they all support the ES6 Proxy Object. Thus Javascript code which contains Compact-DOM needs to be transpiled.

This project aims to provide a transpiler from Compact-DOM to hyperscript, so it can be used by frameworks such as maquette and mithril.

Semantics

The transpiler searches for all occurrences of h.tagname-and-css-classes( and replaces them with h("tagname-and-css-classes",, where tagnames and css classes are 'dasherized'. For mithril, the m can be used instead of the h.

Readme

Keywords

none

Package Sidebar

Install

npm i compact-dom

Weekly Downloads

1

Version

0.4.1

License

MIT

Last publish

Collaborators

  • johangorter