lumo

:lumo: Standalone ClojureScript environment. Currently at version 1.9.0
hlship 2017-09-09T00:08:58.000156Z

BTW, I suspect there's a problem using the cache (-K) when code includes RE literals. I'd have the code work fine once, then fail with:

No such namespace: fs, could not locate fs.cljs, fs.cljc, or JavaScript source providing "fs"
         (new)
         Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:1923:72)
         Function.cljs.analyzer.error.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:2555:92)
         Function.cljs.analyzer.error.cljs$core$IFn$_invoke$arity$2 (NO_SOURCE_FILE <embedded>:2554:92)
         (NO_SOURCE_FILE <embedded>:5553:162)
         Object.lumo.repl.load_other (NO_SOURCE_FILE <embedded>:6351:378)
         lumo.repl.load (NO_SOURCE_FILE <embedded>:6355:96)
         Function.cljs.js.require.cljs$core$IFn$_invoke$arity$5 (NO_SOURCE_FILE <embedded>:5555:77)
         (NO_SOURCE_FILE <embedded>:5529:284)
         Object.cljs.js.run_async_BANG_ (NO_SOURCE_FILE <embedded>:5529:38)
Remove the cache, or removing the -K flag, makes things work properly.

anmonteiro 2017-09-09T00:15:59.000020Z

@hlship not about regexes, that’s fixed in master

anmonteiro 2017-09-09T00:16:09.000046Z

you can alias and refer too

👍 1
anmonteiro 2017-09-09T00:16:19.000085Z

(require '[child_process :refer [execSync]])

hlship 2017-09-09T00:18:53.000037Z

Can you do that from :require of ns?

hlship 2017-09-09T00:19:35.000080Z

Yes.

anmonteiro 2017-09-09T01:13:09.000006Z

yeah

anmonteiro 2017-09-09T01:13:29.000023Z

@hlship feel free to ping me here, I don’t always see messages if not pinged

stbgz 2017-09-09T19:32:49.000008Z

just released a new version of calvin-cljs that has multiple fixes including some by @richiardiandrea and @plexus, thanks all for the contributions

👍 2
stbgz 2017-09-09T19:33:32.000068Z

find it at: https://www.npmjs.com/package/calvin-cljs

2017-09-09T21:38:30.000052Z

I think I have figured out how to access node libraries from cljs code running in lumo, but haven't yet figured out how to use clojurescript libraries packaged as jars, e.g. on clojars. Do I need to make a project.clj file and do lein deps? Do I need to then also need to create a package.json and do something with npm in order to resolve node dependencies?

anmonteiro 2017-09-09T21:39:10.000076Z

@gschiltz a project.clj and lein deps is a good start

anmonteiro 2017-09-09T21:39:55.000064Z

then just run lumo it with

$ lein classpath > cp.txt
$ lumo -c `cat cp.txt` myscript.cljs

2017-09-09T21:44:49.000046Z

Thanks. I'll give it a try.

2017-09-09T22:08:27.000032Z

That got me part way. The case I'm looking at is how to use the tubax XML library, which is available on clojars. I put a dependency to tubax in my project.clj, did the lein classpath, then invoked lumo -c cat cp.txt to get a REPL. If I do a (require 'tubax.core), I get errors about needing sax. Apparently tubax uses a node module called sax, so I did a "npm install sax", which installed sax in the node_modules directory. I then repeated the above steps, but get the same results. Any ideas? By the way, the project.clj I created just is the following: (defproject tubax-test "0.1.0-SNAPSHOT" :dependencies [[org.clojure/clojure "1.8.0"] [funcool/tubax "0.2.0"]])

anmonteiro 2017-09-09T23:12:31.000049Z

@gschiltz found your issue

anmonteiro 2017-09-09T23:12:39.000053Z

(require 'v8)
(v8/setFlagsFromString "--nouse_strict")

anmonteiro 2017-09-09T23:12:46.000048Z

^ run this before requiring that library

anmonteiro 2017-09-09T23:13:09.000017Z

tracking issue: https://github.com/anmonteiro/lumo/issues/225