3 ms·
Sorry for the noob question, but: does this take the place of Hiccup? Or, would one use both at the same time?
by elwell 13y ago
Sorry for the noob question, but: does this take the place of Hiccup? Or, would one use both at the same time?
- drcode 13y agoHiccup 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)
- danh 13y agoFirstly, 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.
- lgas 13y agoAs 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 https://github.com/teropa/hiccups - Basically a straight port of hiccup to ClojureScript. https://github.com/ibdknox/crate https://github.com/ibdknox/crate - Returns dom nodes instead of strings. https://github.com/lynaghk/singult https://github.com/lynaghk/singult - Works in Clojure or ClojureScript and offers live merging of nodes into the dom. https://github.com/Prismatic/dommy 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.