Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Templating in ClojureScript [closed]

I'd like to use ClojureScript to make a "single page" style web app. To that end, I need a client-side templating system. Does anyone have any experience and/or recommendations on which ClojureScript templating systems I should look into? Thanks.

like image 641
Ari Avatar asked Jan 04 '13 02:01

Ari


4 Answers

you might have a look at dommy, a templating system written/used by Prismatic.

like image 94
arnaud_st Avatar answered Nov 04 '22 03:11

arnaud_st


I've found crate to be helpful.

like image 32
bmaddy Avatar answered Nov 04 '22 04:11

bmaddy


Having used both Crate and Dommy I can say that they are both very good. Crate is just an implementation of Hiccup from Clojure converted to Clojurescript for templating, so you will still need to use Domina to select elements. If you want a framework that handles both DOM selection AND templating then use Dommy

like image 2
yazz.com Avatar answered Nov 04 '22 04:11

yazz.com


I know three templating flavors for Clojurescript:

  1. Dommy: Create and manipulate DOM nodes directly from cljs code.
  2. Crate: Declare and manipulate cljs data (vectors,maps, etc.) which are then transformed into DOM nodes.
  3. Enfocus: Write HTML in HTML files, process them and transform them from cljs. It is a different way of thinking about templating, and it is based on the clj library Enlive.

There are libraries that produce React DOM nodes instead of normal DOM nodes but work in the same way as those mentioned above:

  1. Any Cljs React wrapper, like Om or Reagent
  2. Sablono
  3. Kioo

I know you are only asking for templating and React comes with more than that, but if you need anything besides the most basic operations, I would recommend any React based approach.

like image 2
sbensu Avatar answered Nov 04 '22 03:11

sbensu