Yes.

I've created a jquery wrapper conveniently called cljs-jquery ,
however there is no documentation, tests, or general housekeeping yet
so haven't announced it. If you are brave,
https://github.com/kovasb/cljs-jquery

Previous libraries have followed the lead of the initial Clojurescript
examples, and tried to wrap gclosure to make it more
clojure-idiomatic.

I think this whole approach is a mistake.

This is not a generic data processing problem, so we shouldn't be
converting the dom into verbose generic clojure structures with
namespace prefixes everywhere.

DOM manipulation is ideally suited to a DSL. JQuery already defines
the primitives, and provides the implementation. Lets just wrap it.

The idea of my library is trivial. Just have a macro that expands into
a jquery call chain:

$(selector).f(a,b).g(c,d)
is represented by
($ selector (f a b) (g c d))

(note that f and g don't need buzz-killing namespace prefixes)

For bonus points, selector can be a hiccup structure (or a hiccup
structure with embedded dom objects) which ends up saving a huge
amount of code when creating new elements.

In general this is far more concise and easier to code than any other
approach I've seen thus far.

On Fri, Jan 6, 2012 at 3:16 AM, Shantanu Kumar <kumar.shant...@gmail.com> wrote:
> Is anybody working on a DOM-manipulation library for ClojureScript?
>
> There are several JavaScript libraries that can probably be wrapped,
> but a ClojureScript library should be great. I noticed a short
> comparative list of jQuery basic operations vs JavaScript equivalent
> that looks interesting: http://sharedfil.es/js-48hIfQE4XK.html
>
> Shantanu
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to