"Declarativ" is a lightweight and asynchronous HTML templating library for JavaScript. It definitely isn't my own reinvention of React's JSX. Okay, it kind of is, but whatever, it's still cool.
Declarativ allows you to write a document tree using a series of nested function calls, much like how Declarative UI works inside Flutter or in Jetpack Compose. Here's an example:
container(
jumbotron(
h1("This is a big header."),
button("Do something").on("click", () => alert("Hello!")),
p($.get("https://loripsum.net/api/plaintext"))
)
)
<script type="text/javascript" src="https://unpkg.com/declara