Fork me on GitHub

sometimes it's really hard to find the js/NAME after require some foreign js libraries.


I noticed I often have of issues with the tooling and once things go astray it takes a lot of effort to fix.. Nrepl, Figwheel, Piggieback, Austin. I’d like to keep things to the minimum without sacrificing convenience (autocomplete, cljs repl). Any suggestions on the workflows? Maybe sample projects I could use as a reference?


@dnolen the “Getting Started” link on returns a 404

Pablo Fernandez09:10:02

I created a library called free-form and it has a namespace called but a project using this library cannot find it. I get this error: No such namespace:, could not locate free_form/re_frame.cljs, free_form/re_frame.cljc, or Closure namespace ""


Its looking for source directory free_form, do you have it?

Pablo Fernandez09:10:03

@hlolli it’d be in the library I’m using, not in the current project.

Pablo Fernandez09:10:38

Interestingly, Cursive doesn’t seem to see the library either.


How did you create your library, could it be that the namespace name was incorrectly created against your source structure?


Dont see anything either. Must be something so simple that is being overseen. If the library compiles correctly and is in your dependencies, it should be fine. Did you add this to clojars?

Pablo Fernandez09:10:05

How do I install a jar in my local system? To debug how i’m packaging it.


With leiningen you can add a jar to source path (with boot I've had some diffuculties with that).


:src ["src/cljs" "dir/jarfile.jar" ..etc...]


@pupeno the sources are in the wrong directory in the jar


add :source-paths ["src/cljs"] to your project.clj


then release the jar again


~/.m2/repository/com/pupeno/free-form/0.4.0]$ jar -tvf free-form-0.4.0.jar
   119 Mon Oct 24 10:56:24 CEST 2016 META-INF/MANIFEST.MF
  2722 Mon Oct 24 10:56:24 CEST 2016 META-INF/maven/com.pupeno/free-form/pom.xml
  1195 Mon Oct 24 10:56:24 CEST 2016 META-INF/leiningen/com.pupeno/free-form/project.clj
  1195 Mon Oct 24 10:56:24 CEST 2016 project.clj
  9535 Mon Oct 24 10:56:24 CEST 2016 META-INF/leiningen/com.pupeno/free-form/
 11218 Mon Oct 24 10:56:24 CEST 2016 META-INF/leiningen/com.pupeno/free-form/LICENSE
     0 Mon Oct 24 10:56:24 CEST 2016 META-INF/
     0 Mon Oct 24 10:56:24 CEST 2016 META-INF/maven/
     0 Mon Oct 24 10:56:24 CEST 2016 META-INF/maven/com.pupeno/
     0 Mon Oct 24 10:56:24 CEST 2016 META-INF/maven/com.pupeno/free-form/
   147 Mon Oct 24 10:56:24 CEST 2016 META-INF/maven/com.pupeno/free-form/
     0 Mon Aug 15 19:12:48 CEST 2016 cljs/
     0 Mon Oct 24 10:38:38 CEST 2016 cljs/free_form/
  6938 Mon Oct 24 10:38:38 CEST 2016 cljs/free_form/core.cljs
   593 Mon Aug 22 18:50:56 CEST 2016 cljs/free_form/re_frame.cljs



Pablo Fernandez09:10:40

@thheller I was just trying that fix… thanks for confirming.


because the standard :source-paths is src

Pablo Fernandez09:10:56

Now I’m wondering… how did this ever worked. Because it used to work.


the cljsbuild config has the :source-paths but that does not affect lein jar

Alex Miller (Clojure team)13:10:42

@slipset that's weird - I will fix that


I made an issue of it on github.


Am at #euroclojure right now, so not in position to propose a solution 🙂

Alex Miller (Clojure team)13:10:25

fix deploying now - that page was from the clojure site and never got updated

Alex Miller (Clojure team)13:10:17

actually, that page should never show up as it should get covered by a redirect, however the prior build failed so was only partially deployed (did not get to installing the redirects), which was a good thing to catch. I’ve installed the same automatic retry logic I use on the clojure site for the case of intermittent AWS failures so this won’t happen again.


out of curiosity, has anyone worked with jstat before? I'm trying to get it to play nice with cljs and not having any luck, even when I drop down to native js arrays. e.g.:

(def test-mini (js/jStat (array [[1 2] [3 4] [5 6]])))
(.log js/console (.dimensions test-mini))
returns {rows: 1, cols: 1} -- which is obviously incorrect. Working w/o any compiler optimizations...


@gowder the inner vectors are still vectors


no idea what jStat is but you probably want #js [#js [1 2] #js [3 4] #js [5 6]]


or just use clj->js


if I have a page that includes two separate files compiled via clojurescript, is there a way for one to get access to the namespaces and vars of the other? assume they are both compiled with :optimizations :none but are compiled completely separately.


Ooooh thanks @thheller --- bet that will solve it. (jStat is a js stats library. I'm messing around with in-browser data analysis)


@gowder - clj->js is super-handy for investigative/exploratory situations like the one you’re currently in, where you’re just trying to get something working quickly+simply, but FYI it’s slow when called a bunch of times in a tight loop, so just remember i said this if you start pumping a ton of data into your project and notice it has frame rate issues 🙂


(chrome devtools’ profiler is super-great for tracking down performance issues)


Hah yeah, good call @jrheard --- I'm not really loving all this interop in general, thinking I might just roll my own stats


if you’ve got the time and want to have that experience, goforit! there are a ton of js stats/graphing/etc libraries, though, and once you get used to it, js interop isn’t all that paintful 🙂


agreed that it feels clunky at first


but anyway do what you see fit, have a great time, glgl


heh thanks. I'm poking around right now, and yeah, it doesn't look like there's a good pure cljs matrix algebra solution (not a ton of full-featured core.matrix impls I can find on the js platform), and while I've rolled a little bit of stats on my own, it's only been in python where numpy is available... not all that excited about rolling my own matrix algebra library to avoid interop!


also pretty sure any perf loss I'm giving up messing around with stuff like clj-js would be nothing compared to the perf loss from trying to write my own matrix math


have you seen ? says it supports clojurescript


found via the math section of (it’s missing the cljs tag on that site)


I think it supports clojurescript in principle, but it looks like it requires a pluggable implementation, and the one I can find doesn't have much of the math defined. might be misreading the code though...


ah, gotcha


i don’t know much about matrix algebra in any context, much less cljs, so i’m not very helpful here :’(


although come to think about it, I'm poking around in the core.matrix code again and it looks like a lot of stuff is in the default implementation... so maybe the math is there! that would be exciting 🙂


(clearly the answer is to try some experiments...)


Hi all, I'm playing with this: and I'm trying to use a nodejs lib for the main electron process, but it seems I cannot use node's require. Is this possible?


@mping cljs.nodejs/require?


Is it possible to find the jar file a cljs file lives in? Possibly with lein’s help?


what I’m really after is a cljs analog to