3 ms·
Nice project! I do wonder though if jsx is the best way to represent elements in code? Clojure datastructures makes this so much more enjoyable. Everything is
by drikerf 2y ago
Nice project! I do wonder though if jsx is the best way to represent elements in code?
Clojure datastructures makes this so much more enjoyable. Everything is just basic lists and maps which makes it very flexible and powerful.
[:ul
[:li "task 1"]
[:li "task 2"]]
It's weird that it's not more common for making web apps.
- globular-toast 2y agoThere is a library for Python called htpy that does this. Trouble is if you're used to HTML it can take a while to get used to it. It's like a learned helplessness or something.
- edflsafoiewq 2y agoThere are a lot of DOM util libraries that look like h("ul", h("li", "task 1"), h("li", "task 2")) This is called "hyperscript-style" after an early library that used it. This is basically what JSX compiles to too. There used to be a lot of JSX vs hyperscript debates. There's also variants like h.ul(h.li("task 1"), h.li("task 2")) using Proxies now too.