cljsjs

mikebelanger 2016-09-11T14:59:13.000294Z

Hi guys I’m having a hard time using any of the cljsjs libraries. I have a feeling there’s something off about my project build settings, maybe I’m using the wrong version of boot-cljs? `(set-env! :source-paths #{"src/"} :resource-paths #{"assets/"} :dependencies '[[org.clojure/clojurescript "1.9.229"] [org.clojure/clojure "1.8.0"] [adzerk/boot-cljs "1.7.228-1"] [cljsjs/cortical-io "1.0-0"] [proto-repl "0.3.1"]]) (require '[adzerk.boot-cljs :refer [cljs]]) (deftask build [] (comp (cljs) (target) (watch) (cljs) (repl))) `

martinklepsch 2016-09-11T15:00:54.000295Z

this seems right. Are you requiring cljsjs.cortical-io somewhere? @mikebelanger

mikebelanger 2016-09-11T15:01:40.000296Z

@martinklepsch yeah, here’s the file : (ns cube-test.core (:require [cljsjs.cortical-io]))``

martinklepsch 2016-09-11T15:03:17.000297Z

do you get an error of any kind?

mikebelanger 2016-09-11T15:03:17.000298Z

@martinklepsch Sorry for the formatting, the above is the whole file. I’ve tried a bunch of other libraries in cljsjs as well, with the same result. I’ve tried deleting/re-downloading my maven repos as well. Not sure what is going on.

mikebelanger 2016-09-11T15:04:02.000299Z

@martinklepsch yeah

java.io.FileNotFoundException: Could not locate cljsjs/cortical_io__init.class or cljsjs/cortical_io.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.

mikebelanger 2016-09-11T15:05:44.000300Z

@martinklepsch so the above error is the same, regardless of the cljsjs package. Here’s the boot version:

BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.7.0
BOOT_VERSION=2.6.0

mikebelanger 2016-09-11T15:06:53.000301Z

@martinklepsch I only get that error if I require. Otherwise it loads fine, so I don’t think its a top-level namespace declaration thing.

mikebelanger 2016-09-11T15:15:39.000302Z

@martinklepsch Actually, to clarify I’ve only tried using [cljsjs/react "15.3.1-0”] [cljsjs/three "0.0.76-0”] and require’d in the same way. Seems like too much of a coincidence.

mikebelanger 2016-09-11T15:20:33.000303Z

I’ve looked at all three of those Maven repos, they look like the usual structure.

mikebelanger 2016-09-11T15:39:47.000304Z

I’ve based my overall structure on this, https://github.com/clojure-china/minimal-cljs, which seemed to work

flyboarder 2016-09-11T15:52:12.000306Z

@mikebelanger: make sure you relaunch boot when you change deps

flyboarder 2016-09-11T15:52:36.000307Z

Otherwise they don't download

mikebelanger 2016-09-11T16:06:28.000308Z

@flyboarder I’m relaunching boot every time, mainly because it doesn’t even make it to the (watch) task 😛. My maven repos appear to have the JARs for these libraries.

flyboarder 2016-09-11T16:07:53.000309Z

Why do you have multiple cljs tasks in your pipeline?

flyboarder 2016-09-11T16:08:17.000310Z

@mikebelanger: also your target task should come last

flyboarder 2016-09-11T16:09:46.000311Z

Repl and watch don't work well together from my experience either

flyboarder 2016-09-11T16:14:01.000312Z

Try just watch cljs target

mikebelanger 2016-09-11T16:44:52.000313Z

@flyboarder ok yeah that’s true, no need for additional cljs if always watching.

mikebelanger 2016-09-11T17:07:56.000314Z

@flyboarder Ok tried making my build task just (watch) (cljs) (target) — still getting the error. At this point I think it’s easier to just upload the entire project, for anyone interested.

flyboarder 2016-09-11T17:08:28.000315Z

yeah if there is a repo that might help

mikebelanger 2016-09-11T17:14:28.000316Z

Ok its at https://github.com/mikebelanger/minimal_cljs_master

mikebelanger 2016-09-11T17:16:13.000318Z

adzerk.boot_cljs.util.proxy$clojure.lang.ExceptionInfo$ff19274a: ERROR: No such namespace: cljsjs.three.deps, could not locate cljsjs/three/deps.cljs, cljsjs/three/deps.cljc, or Closure namespace "cljsjs.three.deps" in file /Users/mikebelanger/.boot/cache/tmp/Users/mikebelanger/Downloads/minimal_cljs_master/22z/-grrwi1/minimal_cljs/core.cljs at file src/minimal_cljs/core.cljs
and here’s the error I’m getting.

mikebelanger 2016-09-11T17:23:03.000319Z

and I dunno if posting my maven repository is useful, but it looks like three has been downloaded, and its all wrapped up in a .jar in the cljsjs directory.

mikebelanger 2016-09-11T17:46:12.000320Z

….wait, does boot automatically decompress .jars?

flyboarder 2016-09-11T18:08:03.000321Z

Boot adds the jar contents to the fileset

flyboarder 2016-09-11T18:08:11.000322Z

Sorry classpath

flyboarder 2016-09-11T18:11:21.000323Z

@mikebelanger where are you getting this cljsjs.three.deps namespace from?

flyboarder 2016-09-11T18:12:13.000324Z

i think you just want cljsjs.three

flyboarder 2016-09-11T18:12:27.000325Z

https://github.com/cljsjs/packages/tree/master/three

mikebelanger 2016-09-11T18:12:59.000327Z

@flyboarder I based it off of this tutorial : https://github.com/cljsjs/packages/wiki/Using-Packages

flyboarder 2016-09-11T18:15:09.000329Z

I dont see anywhere it requires appending .deps to the namespace, each package has it’s own readme file in the git repo with how to include it.

mikebelanger 2016-09-11T18:20:31.000330Z

I was basing the name off of the .jar structure, as the error messages kept telling me what sort of filenames they expected.

mikebelanger 2016-09-11T18:23:57.000331Z

@flyboarder I got the repo here: https://clojars.org/cljsjs/three/versions/0.0.76-0 The only documentation I see is to the original JS library.

mikebelanger 2016-09-11T18:27:03.000333Z

@flyboarder yeah I’d go by a README if it existed.

flyboarder 2016-09-11T18:27:32.000334Z

It does I posted the link

flyboarder 2016-09-11T18:27:46.000335Z

https://github.com/cljsjs/packages/tree/master/three

flyboarder 2016-09-11T18:28:03.000336Z

@mikebelanger:

flyboarder 2016-09-11T18:28:39.000337Z

All cljsjs packages read me are in the repo :) it would be nice if the site linked to them

mikebelanger 2016-09-11T18:29:43.000338Z

@flyboarder Oh I’m a fool! Cool thanks I’ll remember to look at the github repo for now on 😛

flyboarder 2016-09-11T18:32:18.000340Z

Yeah that's the best place to check for documentation usually

mikebelanger 2016-09-11T18:52:25.000341Z

yeah it’d be kind of nice if that was linked in the clojars site, but I guess that’s a separate site from cljsjs.

flyboarder 2016-09-11T19:26:01.000342Z

@mikebelanger generally the cljsjs builds reference the original js project repo so i dont think there is anything that actually points to the readme. You kinda have to “know”.

mikebelanger 2016-09-11T20:32:14.000343Z

@flyboarder I guess, yeah