lynaghk / c2

Declarative data visualization in Clojure(Script).
http://keminglabs.com/c2/
Other
643 stars 52 forks source link

cljs compilation errors #49

Open floybix opened 10 years ago

floybix commented 10 years ago

Hi,

I ran into errors using c2 with recent clojurescript versions. For example if I make the following patch to the c2-demos/hello-bars project.clj:

 (defproject hello-bars "0.0.1-SNAPSHOT"
   :description "hello-bars: c2 at its simplest"
-  :dependencies [[org.clojure/clojure "1.4.0"]
-                 [com.keminglabs/c2 "0.2.1"]]
+  :dependencies [[org.clojure/clojure "1.5.1"]
+                 [org.clojure/clojurescript "0.0-2227"]
+                 [com.keminglabs/c2 "0.2.3"]]
   :min-lein-version "2.0.0"
   :source-paths ["src/clj"]

-  :plugins [[lein-cljsbuild "0.2.7"]]
+  :plugins [[lein-cljsbuild "1.0.3"]]

Then I get the following from lein cljsbuild:

Compiling "public/out/hello-bars.js" from ["src/cljs"]...
WARNING: Referred macro reflex.macros/capture-derefed does not exist at line 1 file:/home/felix/.m2/repository/com/keminglabs/reflex/0.1.1/reflex-0.1.1.jar!/reflex/core.cljs
WARNING: No such namespace: singult.coffee at line 1 file:/home/felix/.m2/repository/com/keminglabs/singult/0.1.6/singult-0.1.6.jar!/singult/core.cljs
WARNING: No such namespace: singult.coffee at line 1 /home/felix/devel/c2-demos/hello-bars/target/cljsbuild-compiler-0/singult/core.cljs
WARNING: Referred macro reflex.macros/capture-derefed does not exist at line 1 /home/felix/devel/c2-demos/hello-bars/target/cljsbuild-compiler-0/reflex/core.cljs

And fatal runtime errors:

Uncaught Error: goog.require could not find: singult.coffee 

I'm not sure how to go about investigating this.

Best Felix

lynaghk commented 10 years ago

Hi Felix,

The ClojureScript compiler and/or lein cljsbuild has changed how it detects and pulls in JavaScript sources from JAR files. I think @cemerick has explained the change on the original issue (https://github.com/emezeske/lein-cljsbuild/issues/95) but I haven't had time to update all of the affected libraries.

If you want to make the changes and test under latest tooling, I'd love to get a pull request

kelseyq commented 9 years ago

any update on this? I've been using d3 in cljs projects but would love to switch to C2 where possible

lynaghk commented 9 years ago

Hi @kelseyq,

I think much of the DOM stuff in C2 isn't worth messing with anymore: React.js is a much better implementation of many of the same ideas. Take a look at Sablono (https://github.com/r0man/sablono) for DOM stuff---you can still use all of C2's scale and layout helpers in that framework.

If I can ask: What in particular appeals to you about C2 vs. D3 from ClojureScript?

kelseyq commented 9 years ago

interested in the viz helpers. would i use those with sablono by just not importing core?

lynaghk commented 9 years ago

Yeah, you can just import whatever fns you need---most don't rely on core whatsoever.