hi, I think I'm almost there but I can't figure out how to include an
external js lib in a cljs one project. What's the correct way to do it
when working in development mode?

I have a dependency on unicodetiles.js in project.clj:

  :git-dependencies [<other dependencies here>
                     ["https://github.com/tapio/unicodetiles.js.git";
                      "8a1922b4977685bc168de147efc2a9c72a958b08"]]

And I added that to the classpath (not sure if that's necessary):

  :extra-classpath-dirs [<other directories here>
                         ".lein-git-deps/unicodetiles.js/
unicodetiles"]

In the compiler options in config.clj I tried adding :foreign-libs
following 
http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html:

(def ^{:doc "Configuration for the sample application."}
  config {<other options here>
          :foreign-libs [{:file "C:/george/work/great-mystery/.lein-
git-deps/unicodetiles.js/unicodetiles/unicodetiles.js" :provides
["ut.core"]}]
<more options here>})

And from a view.cljs file tried to require the namespace:

  (:require <other namespaces here>
            [ut.core :as ut]))

Working in development mode I get the error:

Uncaught Error: Undefined nameToPath for ut.core
asserts.js:71Uncaught TypeError: Cannot read property 'Error' of
undefined
event.js:44Uncaught TypeError: Cannot read property 'EventTarget' of
undefined
eventtype.js:58Uncaught TypeError: Cannot read property 'IE' of
undefined
2base.js:1364Uncaught TypeError: Cannot read property 'prototype' of
undefined
events.js:996Uncaught TypeError: Cannot call method
'setProxyCallbackFunction' of undefined
base.js:1364Uncaught TypeError: Cannot read property 'prototype' of
undefined
pools.js:137Uncaught TypeError: Cannot read property 'HAS_JSCRIPT' of
undefined
net.js:10Uncaught ReferenceError: cljs is not defined
repl.js:5Uncaught ReferenceError: cljs is not defined
base.js:284goog.require could not find: ut.core
base.js:287Uncaught Error: goog.require could not find: ut.core
animation.js:73Uncaught ReferenceError: cljs is not defined
color.js:406Uncaught ReferenceError: cljs is not defined
dom.js:156Uncaught ReferenceError: cljs is not defined
base.js:1364Uncaught TypeError: Cannot read property 'prototype' of
undefined
domina.js:785Uncaught ReferenceError: cljs is not defined
animation.js:13Uncaught ReferenceError: cljs is not defined
remote.js:120Uncaught TypeError: Cannot call method 'call' of
undefined
html5history.js:50Uncaught TypeError: Object #<Object> has no method
'assert'
core.js:24Uncaught TypeError: Cannot call method 'call' of undefined
extensions/event.js:185Error in event handler for 'undefined':
TypeError: Cannot call method 'split' of undefined
    at chrome-extension://kecaejkkcpijbbnnmnkpcpgiifdplcia/content.js:
11:45
    at extensions/miscellaneous_bindings.js:264:13
    at [object Object].dispatch (extensions/event.js:183:28)
    at Object.<anonymous> (extensions/miscellaneous_bindings.js:
164:22)

Is :foreign-libs not what I want here? Thanks.







-- 
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