hey! i just started using lumo & i really like it
but i'm uncertain how to add cljs dependencies to my project
@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
hm ok
i've never done any cljs really, and i've only ever used lein
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
sorry to be kind of dense about this, but:
i'm downloading boot so i can use boot -d
as suggested by the planck docs
Yeah, you can use boot, or if you are more comfortable doing so, you can use lein to download deps
(boot just happens to have some nice syntax to do that directly on the command line)
well it's not a bad time to learn boot i guess
No need to learn all of boot, just to download a dep using it π
well i'd like to have a documented/repeatable thing
like lein has a project.clj
where the deps go
i'm not necessarily planning on distributing this as a library or even necessarily running it more than like once
but it's good to like document stuff
i'm a python guy at heart and feel uncomfortable without a requirements.txt
-equivalent
i'm sorry to keep being such a dummy, but
i've downloaded specter using boot -d
but i can't require
it in my lumo repl
because .m2/repository/com/rpl/specter/1.0.5
only has jars
and the repl keeps asking for com/rpl/specter.cljs
/`com/rpl/specter.cljc`
should i just clone the source?
@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/
(blog is a year old, so things may have changed)
Seemed still valid a couple of months ago: https://clojurians-log.clojureverse.org/lumo/2017-06-15.html
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)
π
@swizzard https://github.com/nathanmarz/specter/issues/72 There is an older version of Specter which worked with self-hosted ClojureScript IIRC
$ lumo -qD com.rpl/specter:0.12.0
cljs.user=> (require '[com.rpl.specter :as s])
nil
oof
ok
the latest version is 1.0.5
π
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 π
alas
In other words, 0.12.0 is probably OK if you are just messing around
fair enough
Or, once you've mastered this stuff, contribute the changes needed to make it work π
all i wanted was to use brain.js to make names for a tracery-based nanogenmo project
For people looking to help out in Lumo, thereβs only 1 pending task to do before releasing 1.8
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)