Fork me on GitHub
#cljs-dev
<
2017-10-04
>
chbrown17:10:46

I'm having trouble :require'ing a particular :npm-deps installed package: "No such namespace: [...]"; it works for other :npm-deps so I figure there's just something weird about this particular library (https://github.com/uber/react-vis)

chbrown17:10:45

What's a good way to debug this? Is there a way to list all the namespaces provided by my :npm-deps?

chbrown18:10:03

I tried (closure/maybe-install-node-deps! opts) (closure/index-node-modules ["react-vis"] opts) from closure_tests.clj, for opts {:npm-deps {:react-vis "1.7.9" :react "16.0.0" :react-dom "16.0.0"}} but the latter returns nil (I suspect there's some side-effecting setup I'm missing)

richiardiandrea18:10:01

^ this is an awesome way to use npm from the repl btw 😉

mfikes19:10:58

Clojure prints negative zero as -0.0. I presumed that to have ClojureScript print it as -0 would be prohibitively expensive. Interestingly, this doesn't appear to be the case. By adding

(zero? obj) (if (neg? (/ obj)) "-0" "0")
to the number? cond in pr-writer-impl, printing may actually be running faster. Benchmark results here https://gist.github.com/mfikes/862114a2c4675d6f0b375ac9212a7156 If there is no strong objection or reason not to do this, I could write up a JIRA ticket with the patch.

thheller19:10:00

@io react-vis uses d3 which uses a bad UMD wrapper, which breaks the import via :npm-deps

thheller19:10:32

also "main":"dist" may be an issue, not sure if that is fixed yet. I think there was a ticket for it

slipset19:10:32

Probably very n00b question, but I'm looking into https://dev.clojure.org/jira/browse/CLJS-2268

slipset19:10:23

My problem is that I cannot seem to get the tests in src/test/cljs/clojure/string_test.cljs to be run.

slipset19:10:04

$ lein test clojure.string-test
(:repositories detected in user-level profiles! [:user]
See 
Exception in thread "main" java.io.FileNotFoundException: Could not locate clojure/string_test__init.class or clojure/string_test.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name., compiling:(/private/var/folders/jd/9331p3q10ng42jc_d9x_jqz80000gn/T/form-init4952422270888031285.clj:1:125)

slipset19:10:16

What am I missing?

rauh20:10:17

It's confusing in the beginning, but thankfully documented: https://github.com/clojure/clojurescript/wiki/Running-the-tests

slipset20:10:13

Jupp, I saw that, but didn't understand it. Installed v8 and running with that shows tests failing.