|
even simpler, I have always wished that JSX/JSX-alikes would serialize to something like a tuple like `(tag: string | Component, attributes: Record, children: List)`, so your example would start looking something like this: <div class="example">
<h1 id="heading">This is an example</h1>
<h2>creating React markup</h2>
<AnotherComponent foo="bar">
<li>
<a href="http://whatever.com">One list item</a>
</li>
<li>
Another list item <hr />
</li>
</AnotherComponent>
</div>
would translate to something like this: ["div", {"class": "example"}, [
["h1", {"id": "heading"}, ["This is an example"]],
["h2", {}, ["creating React markup"]],
[AnotherComponent, {"foo": "bar"}, [
["li", {}, [
["a", {"href": "http://whatever.com"}, ["One list item"]],
],
["li", {}, [
"Another list item",
["hr", {}, []],
],
],
]
and that all Rux/JSX/hyperscript/whatever would compile down to that |