Clojurians
#lumo
<
2017-11-25
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

swizzard19:11:04

hey! i just started using lumo & i really like it

swizzard19:11:18

but i'm uncertain how to add cljs dependencies to my project

mfikes19:11:33

@swizzard They are handled just as with regular ClojureScript: Depend on JAR files on the classpath. Lumo has a -c / --classpath argument, as well as -D / --dependencies argument, which provides some sugar for specifying the classpath

swizzard19:11:40

i've never done any cljs really, and i've only ever used lein

mfikes19:11:43

Lumo is practically identical to Planck with respect to this, so much of the material at http://planck-repl.org/dependencies.html is likely relevant

swizzard19:11:02

sorry to be kind of dense about this, but:

swizzard19:11:37

i'm downloading boot so i can use boot -d as suggested by the planck docs

mfikes19:11:25

Yeah, you can use boot, or if you are more comfortable doing so, you can use lein to download deps

mfikes19:11:45

(boot just happens to have some nice syntax to do that directly on the command line)

swizzard19:11:03

well it's not a bad time to learn boot i guess

mfikes19:11:39

No need to learn all of boot, just to download a dep using it :slightly_smiling_face:

swizzard19:11:57

well i'd like to have a documented/repeatable thing

swizzard19:11:19

like lein has a project.clj where the deps go

swizzard19:11:58

i'm not necessarily planning on distributing this as a library or even necessarily running it more than like once

swizzard19:11:08

but it's good to like document stuff

swizzard19:11:01

i'm a python guy at heart and feel uncomfortable without a requirements.txt-equivalent

swizzard20:11:38

i'm sorry to keep being such a dummy, but

swizzard20:11:44

i've downloaded specter using boot -d

swizzard20:11:38

but i can't require it in my lumo repl

swizzard20:11:13

because .m2/repository/com/rpl/specter/1.0.5 only has jars

swizzard20:11:05

and the repl keeps asking for com/rpl/specter.cljs/`com/rpl/specter.cljc`

swizzard20:11:41

should i just clone the source?

borkdude20:11:16

@swizzard I’m not sure, but I think you should apply the same trick as with Planck here: https://blog.michielborkent.nl/blog/2016/10/19/one-off-clojure-libraries/

borkdude20:11:25

(blog is a year old, so things may have changed)

swizzard20:11:44

cljs.user=> (require '[com.rpl.specter :as s])
Could not require com.rpl.specter.navs in file com/rpl/specter.cljc
         (new)
         Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:1928:72)
         Function.cljs.analyzer.error.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:2539:92)
         Function.cljs.js.require.cljs$core$IFn$_invoke$arity$5 (NO_SOURCE_FILE <embedded>:5849:145)
         Function.cljs.js.load_deps.cljs$core$IFn$_invoke$arity$7 (NO_SOURCE_FILE <embedded>:5859:507)
         (NO_SOURCE_FILE <embedded>:5860:420)
         Function.cljs.js.require.cljs$core$IFn$_invoke$arity$5 (NO_SOURCE_FILE <embedded>:5838:1)
         Function.cljs.js.load_deps.cljs$core$IFn$_invoke$arity$7 (NO_SOURCE_FILE <embedded>:5859:507)
         (NO_SOURCE_FILE <embedded>:5860:420)
         Function.cljs.js.require.cljs$core$IFn$_invoke$arity$5 (NO_SOURCE_FILE <embedded>:5838:1)

Maximum call stack size exceeded
         Function.lumo.repl.print_error.cljs$core$IFn$_invoke$arity$2 (NO_SOURCE_FILE <embedded>:6385:96)
         Object.lumo.repl.handle_error (NO_SOURCE_FILE <embedded>:6390:60)
         (NO_SOURCE_FILE <embedded>:6515:177)
         (NO_SOURCE_FILE <embedded>:6014:340)
         (NO_SOURCE_FILE <embedded>:5904:425)
         (NO_SOURCE_FILE <embedded>:5918:218)
         (NO_SOURCE_FILE <embedded>:5863:211)
         (NO_SOURCE_FILE <embedded>:5842:36)
         (NO_SOURCE_FILE <embedded>:6014:340)
         (NO_SOURCE_FILE <embedded>:5904:425)

swizzard20:11:47

:disappointed:

mfikes21:11:26

@swizzard https://github.com/nathanmarz/specter/issues/72 There is an older version of Specter which worked with self-hosted ClojureScript IIRC

mfikes21:11:14

@swizzard

$ lumo -qD com.rpl/specter:0.12.0
cljs.user=> (require '[com.rpl.specter :as s])
nil

swizzard21:11:09

the latest version is 1.0.5

mfikes21:11:48

Yeah, but 0.12.0 was about a year ago, which is about the lifetime of self-hosted ClojureScript in the general scheme of things :slightly_smiling_face:

mfikes21:11:19

In other words, 0.12.0 is probably OK if you are just messing around

swizzard21:11:26

fair enough

mfikes21:11:02

Or, once you've mastered this stuff, contribute the changes needed to make it work :stuck_out_tongue_winking_eye:

swizzard21:11:35

all i wanted was to use brain.js to make names for a tracery-based nanogenmo project

anmonteiro21:11:48

For people looking to help out in Lumo, there’s only 1 pending task to do before releasing 1.8

anmonteiro21:11:20

I’d like to add a lumo.build.api/watch function. Should be the same as cljs.build.api/watch (just swapping out all the JVM APIs with Node.js’s)