> 
> Thanks got it. My mistake was mixing reagent's markup with yours. Would you 
> say this is an alternative, similar to how shadow.markup relates to om.dom?

Yes. While I like the hiccup-ish reagent syntax it does present some 
performance issues.

In reagent you first allocate a bunch of vectors, these are then interpreted by 
reagent and turned into ReactElements allocating even more objects. The vectors 
are now "garbage" and have to be collected. The reagent approach produces about 
twice as much garbage and is slower overall (keyword parsing) as you have way 
more work being done each render, since browsers are pretty fast these days you 
don't notice this much but the price is there.

om.dom or shadow.markup directly go through React.createElement and the result 
will then be interpreted by React effectively skipping the "vector-phase". I 
even go a little further than om.dom if you look at the shadow.markup.react ns 
(direct drop-in replacement btw). I do some macro magic to further reduce cost. 
This is probably overkill though, but you get the usual dom/h1, dom/div, etc 
functions.

I think the reason why the hiccup syntax is so popular is because of the 
shorthand form of :div.class-a.class-b, but since you do not need this with 
defstyled the argument for the hiccup syntax is weaker.

So yes, the hiccup-ish syntax is an alternative but I stick to exclusively 
using the fn-style syntax. Using Cursive indent-only mode it indents just like 
vectors and after doing this for a while now it looks better than the hiccup 
syntax to me. The price of reagent is that you cannot mix both syntaxes, on the 
clojure version I currently support the mixed style but that is probably going 
away at some point.

Sorry, didn't want to turn this into a rant on reagent.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.

Reply via email to