This synatx is called JsonML and I'm maintaining a stable and highly usable implementation: http://adriansieber.com/shaven
Ijk – Transforms arrays into virtual DOM trees
21–30 of 49 posts
Re: Ijk – Transforms arrays into virtual DOM trees
#22Also https://github.com/Jador/react-hyperscript-helpers/blob/mast... which is even more terse
Re: Ijk – Transforms arrays into virtual DOM trees
#23You refer to h but what is it? I searched around but obviously something called h is hard to find.
Re: Ijk – Transforms arrays into virtual DOM trees
#24Looks awesome. Makes me wish I still used LiveScript because of the \string syntax and other features that would go great with ijk. You refer to h but what is it? I searched around but obviously something called h is hard to find.
Re: Ijk – Transforms arrays into virtual DOM trees
#25Looks awesome. Makes me wish I still used LiveScript because of the \string syntax and other features that would go great with ijk. You refer to h but what is it? I searched around but obviously something called h is hard to find.
Re: Ijk – Transforms arrays into virtual DOM trees
#26I like the syntax, but I have to say that I prefer JSX. The real advantage of JSX is that it's very similar to HTML and developers have been reading, mentally modeling and reasoning about HTML -> DOM translation for decades.
That's the disadvantage, too: you gotta use html! Where are the lispers to talk about how much better sexps are? Even with decades of knowledge, I think you'll find that devs can transition to the non-html model really, really quickly, and then it's nice because everything is a single uniform language.
Well... there is the OP...
Re: Ijk – Transforms arrays into virtual DOM trees
#27Re: Ijk – Transforms arrays into virtual DOM trees
#28For example, with Paredit, you can create an element and then move it prev/next/up/down a tree with muscle memory you're already using for the rest of your code.
When I re-entered the Javascript world, I tried arrays-for-html but realized it's unbearable without manipulation tooling. I think something like JSX makes more sense at that point since I find you're more likely to already be using an HTML manipulation tool like Emmet which is more pleasant than hand-editing array structures.
Re: Ijk – Transforms arrays into virtual DOM trees
#29Reminiscent of Breve. https://github.com/cwells/breve I don't see a huge advantage over hyperscript (hyperapp and mithril both use it), but that is a ridiculously small codebase. The JS hate is kind of funny around here, because when you dig into stuff like this, you realize that JS is very lispy in ways (it's easy to build up trees of HTML dynamically). In the mid aughts on r/programming people would rant and rave a…
Re: Ijk – Transforms arrays into virtual DOM trees
#30Improve it a little bit more by by removing the single quote by turning the html tags into functions that accepts 2 arrays: the attributes and the child elements, by this time you will come across with elm in which expressing the html document tree fits perfectly in the language syntax and semantics.
We already have something similar to this at hyperapp.. it is https://github.com/hyperapp/html . But yes, as mentioned by @masklinn, the drawback is you then have to define every element and then import all those definitions. With ijk you can write dependency free views (no import of h or h1, h2, etc.)
https://makandracards.com/makandra/44070-javascript-hash-obj...