News for hackers. Stuff that matters.
Re:Cloact: Minimalistic React for ClojureScript by elwell on Friday January 10, 2014 @02:39PM (#7038829)
Sorry for the noob question, but: does this take the place of Hiccup? Or, would one use both at the same time?
Re:Cloact: Minimalistic React for ClojureScript by danh on Friday January 10, 2014 @03:04PM (#7039002)
Firstly, Hiccup is Clojure (so basically server only). Cloact is ClojureScript, that compiles to javascript (so browser, node.js, etc).

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.

Re:Cloact: Minimalistic React for ClojureScript by drcode on Friday January 10, 2014 @02:56PM (#7038942)
Hiccup is for going html->string

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)

Re:Cloact: Minimalistic React for ClojureScript by lgas on Friday January 10, 2014 @04:31PM (#7039600)
As danh and drcode said, Hiccup is basically edn->text and server side only but there are a number of implementations of the same concept in ClojureScript:

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.