@angelisium/jsx-lite

0.0.6 • Public • Published

JSX Lite

npm GitHub

The philosophy of this project is to provide a light and fast structure to allow the use of the JSX syntax in a JavaScript application to increase your productivity and the maintainability of your project !

All JSX chunk are valid HTMLElement which can then be manipulated as you wish.

Note
If you want to know how to use it, you can see some examples here.

Demonstration :

// classic JS chunk :
var p = document.createElement("p");
p.appendChild(
   document.createTextNode("Hello World")
);
var main = document.createElement("main");
main.setAttribute("class", "light");
main.appendChild(p);
document.body.appendChild(main);

// becomes :
document.body.appendChild(
   <main class="light">
      <p>Hello World</p>
   </main>
);

⚠️ Warning ⚠️

Currently the project does not support :

  • the JSX fragments like <> ... </> or <React.Fragment />.
  • custom elements like <CustomJSXElement />.

No planned JSX fragments support (for now) ; because I cannot find any concrete case requiring the use of fragments ; most can be solved with the use of array and append instead of appendChild.

Readme

Keywords

Package Sidebar

Install

npm i @angelisium/jsx-lite

Weekly Downloads

0

Version

0.0.6

License

MIT

Unpacked Size

7.58 kB

Total Files

5

Last publish

Collaborators

  • angelisium