Interesting approach. I did something similar a while back, took a more function-based approach: https://github.com/undecided/tg At that point, I hadn't really done much react-style apps - will have to see how well that works with React!
Ijk – Transforms arrays into virtual DOM trees
11–20 of 49 posts
Re: Ijk – Transforms arrays into virtual DOM trees
#12I 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.
Re: Ijk – Transforms arrays into virtual DOM trees
#13Improve 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.
Re: Ijk – Transforms arrays into virtual DOM trees
#14Re: Ijk – Transforms arrays into virtual DOM trees
#15Reminiscent 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…
I have been thinking of adding shorthand for id/classes in the tag name like hyperscript or JSnoX.
That would mean you could write `['input#search.large']`
Re: Ijk – Transforms arrays into virtual DOM trees
#16Re: Ijk – Transforms arrays into virtual DOM trees
#17Re: Ijk – Transforms arrays into virtual DOM trees
#18I 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.
To be fair, you could say the same thing about Markdown. And yet here we are.
Re: Ijk – Transforms arrays into virtual DOM trees
#19Interesting approach. I did something similar a while back, took a more function-based approach: https://github.com/undecided/tg At that point, I hadn't really done much react-style apps - will have to see how well that works with React!
I got it working with preact.. didn't try with react!
Re: Ijk – Transforms arrays into virtual DOM trees
#20which is even more terse