I have what I think is a really nice method for using jquery and other js 
libs and their dependencies sanely in clojurescript.

(it will be even better if/when http://dev.clojure.org/jira/browse/CLJS-147 is 
resolved)


by using wrap-js (https://github.com/davesann/wrap-js) you can have 
clojurescript require manage the dependencies for you and insert the 
scripts into the page on bootstrap.js load. In the right order. no manual 
effort required.

briefly:

1. just jQuery

clojars [dsann/dsann-cljs-jquery "0.0.1"]    ( cljs-jquery was already 
taken)

(ns my client
  (:require [cljs-jquery.inline :as _jq]))

; use js/jQuery here - works - no need to include jquery in your html page

2. Even better: jQuery and plugin

clojars [cljs-jquery-sparkline "0.0.1"]   

(ns my client
  (:require [cljs-jquery-sparkline.inline :as _sl]))

; use js/jQuery and (.sparkline ($ ...)) here.  works - no need to include 
jquery or the plugin in your html page

3. And:

feel free to use jayq or any other library building apis on top of jquery.
just be sure to require  [cljs-jquery.inline :as _jq] before you make 
reference to jQuery

4. And!

Its *really *easy to wrap your own libs. 5 minutes and you are away.

see https://github.com/davesann/cljs-jquery-sparkline for an example

see also
https://github.com/davesann/cljs-jquery<https://github.com/davesann/cljs-jquery-sparkline>



Cheers

Dave

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

Reply via email to