Hacker News new | past | comments | ask | show | jobs | submit login

"It's incompatible with standard Javascript libraries, which is why you would use Dommy because you can't use jQuery."

Not true.

    (def $ js/jQuery)
    (.append ($ "body") "hello world")
The reasons you'd use Dommy over jQuery are outlined in the original post.



Not quite. The following shows what doesn't work:

    (def $ js/jQuery)
    (.each ($ "body") (fn [idx, val]
                        (.write js/document "In a lambda")))
The Google Closure Compiler munges names of functions so that any function declared in ClojureScript cannot be called from jQuery which means that no jQuery function that takes a callback can be used. And you really want to use GCC because without its dead code removal a simple helloworld.js file takes more than 700kb.


You just need to compile your ClojureScript with the popular jQuery externs file.


You can mark things so that their names aren't mudged via ^:export.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: