One bit that doesn't look appealing to me in Om, or Cloact is the tree-building. Is there anything in ClojureScript and React right now that will let me build templates in HTML and attach functionality via attributes Angular-style?
It's not just designers who appreciate using declarative markup over programmatic syntax! Of all the people who might understand this, I'd have thought you would be the first in line (as a fan of your work on core.logic and inspiring me to learn prolog)!
I'm not trying to be too non-constructive critical here, I fully admit I haven't tried Om/React, just looked at your blog post about it. So what am I missing?
When you say “declarative” I think you might really just mean “familiar for html experts”. But most html expert should be able to learn the new syntax quite easily, since the relevant parts are less verbose than html, quite regular and straightforward, and semantically equivalent.
If you feel like putting your templates in separate files from your logic, or writing them using an SGML-like syntax, that’s pretty trivial to do in any of these environments.
Why don't you give React a whirl and try not to force Angular thinking on to the React model. Shouldn't take more than an hour or two of investment to make a small toy app to experiment with.
A startled pigeon, looking over its wing, tail up in the air, clearly exposing its backside...
...this is why I'd never get hired as a marketer or designer, never mind the fact I'm no artist.
Knowing what a cloaca is beforehand, and then searching for it anyway on Google produces some truly curious results. I was trying to mentally prepare myself for what I may be about to see, because I couldn't imagine what might be on the other side, that would prompt your reaction. The only thing I could think of was some bizarre new form of bestiality that lurks in the shadows of taboo obscurity.
It turns out that most of the images are of obvious medical or scientific origin. I don't even know why pictures of humans show up in the search. I saw lots of pictures of various reptile junk which was totally expected, and none of it was being unceremoniously violated by unscrupulous human beings, so thank god for that!
Apparently there's a medical condition, "Persistent Cloaca Perineum", which is frequently misdiagnosed as "Imperforate Anus with Rectovaginal Fistula." The pictures that depict the condition are mostly de-identified newborn infants, and they originate from edu domains, but in a google search without proper context, they're kind of unexpected. I guess you learn something new every day...
They mean THIS cloaca: https://en.wikipedia.org/wiki/Cloaca
More importantly, Cloact is much closer to the React model while Om diverges quite a bit because we're interested in enabling patterns that are more difficult otherwise, trivial complete UI state rewind on exceptions/errors, trivial undo, and more powerful operations on the applicate state history oriented at interactive debugging and development.
Of course these values might not interest you and you just want a simple direct mapping onto React. Then Cloact looks awesome! :)
Yes, exactly, Cloact tries to stay really close to plain React. But since it allows you to separate data from rendering, undo should be quite trivial to implement (if you keep all your application data in a single cloact/atom)...
You could still use regular atoms, though, with some extend-type magic. But then you risk messing with non-Cloact code in horrible ways...
For more information on why react breaks preconceived notions of best practices I recommend checking out http://2013.jsconf.eu/speakers/pete-hunt-react-rethinking-be...
Secondly, Hiccup produces strings. Cloact typically creates DOM elements, through React, that change every time a component rendered. But it can also produce an HTML string using the same data, to pre-render a page on the server using node.js.
This library goes from html->React data structure
The React.js system then is responsible for pushing it into the DOM, which it can often do in a way that's more performant than using a string intermediary (by computing deltas)
That's the short of it- The other part is that React is mainly a client-side technology whereas Hiccup is mainly used on the server (though these lines are blurry)
https://github.com/teropa/hiccups - Basically a straight port of hiccup to ClojureScript.
https://github.com/ibdknox/crate - Returns dom nodes instead of strings.
https://github.com/lynaghk/singult - Works in Clojure or ClojureScript and offers live merging of nodes into the dom.
https://github.com/Prismatic/dommy - Dommy is more than just templating but offers a hiccup style templating language too.
And I'm sure there are others.
Sorry, names such as clojure or *jure are not allowed.
If you intend to use this name ironically, please set the
LEIN_IRONIC_JURE environment variable and try again.