HN2new | past | comments | ask | show | jobs | submitlogin

Sorry for the noob question, but: does this take the place of Hiccup? Or, would one use both at the same time?


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.


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)


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: