Clojurians
#lumo
<
2017-03-11
>

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

moxaj16:03:08

can lumo compile foreign-libs? I have a deps.cljs on my classpath, but it seems lumo ignores it

richiardiandrea18:03:15

@moxaj by compile you mean use the build API or just be able to call them in the repl?

moxaj19:03:16

@richiardiandrea call them in the repl

richiardiandrea19:03:40

so for that you just need them on the classpath using the -c argument

richiardiandrea19:03:17

I don't think, but I might be wrong and Antonio can correct me, that lumo does automatic resolution (yet)

anmonteiro19:03:36

no automatic resolution

anmonteiro19:03:36

@moxaj but if you include, say Om Next (which has a deps.cljs file that requires cljsjs.react), you can require cljsjs.react in the REPL but you need to include all the JARs in the classpath

moxaj19:03:42

@anmonteiro I'm trying to load my own library, with its own deps.cljs

anmonteiro19:03:36

sorry, but that doesn't add anything to what I said

anmonteiro19:03:40

I'm happy to help you solve whatever is wrong with your project but you need to provide more details

moxaj19:03:37

sure. So I have src/js on my classpath, inside which there's a deps.cljs and some .js files. Then I call lumo with lumo -c <classpath> ..., and I get a No such namespace ... error.

moxaj19:03:06

hmm wait a moment, gotta investigate something

anmonteiro19:03:18

can you paste the contents of your deps.cljs file?

moxaj19:03:24

{:foreign-libs [{:file        "base64-js/index.js"
                 :provides    ["ferros.base64-js"]
                 :module-type :commonjs}
                {:file        "ieee754/index.js"
                 :provides    ["ferros.ieee754"]
                 :module-type :commonjs}
                {:file        "buffer/index.js"
                 :provides    ["ferros.buffer"]
                 :requires    ["ferros.base64-js" "ferros.ieee754"]
                 :module-type :commonjs}]}

moxaj19:03:59

this is my very first time trying to bundle foreign libs, so the error is probably on my end ^^

anmonteiro19:03:39

does it work in the JVM ClojureScript compiler?

anmonteiro19:03:54

you need to understand we don't support CommonJS module resolution

anmonteiro19:03:00

so that's probably the problem

moxaj19:03:25

we = lumo or clojurescript?

anmonteiro19:03:46

ClojureScript has commonJS resolution

moxaj19:03:28

well, alright :confused:. Is it planned?

anmonteiro19:03:39

@moxaj it's planned to see if we can leverage google-closure-compiler-js to do it

anmonteiro19:03:49

I'm still unsure, haven't looked into it