Fork me on GitHub
#lumo
<
2017-08-03
>
anmonteiro00:08:41

that’s fixed in master

souenzzo00:08:01

I know and I want to install on /usr/lib/node_modules ... In older versions, I was sucessfull.

souenzzo00:08:33

https://github.com/anmonteiro/lumo/blob/master/packages/lumo/package.json#L20 if which nodejs; then nodejs scripts/npm_install.js; else node scripts/npm_install.js; fi (if there is some command called nodejs, use nodejs, else use node). Should work.

anmonteiro00:08:02

but that’s not the problem you’re having

souenzzo00:08:10

Ok. I will install locally for now.

rberger08:08:15

So just for anyone else who follows up on the earlier thread on using some npm git libraries: Turns out the trick for making the

(def git ((js/require "simple-git") "./"))
Work wasn’t the addition of the "./" but the fact that the result of (js/require "simple-git") needed to be executed as a function call. (This might be obvious to others but it wasn’t to me.) I put together what I learnt into an example git repo https://github.com/rberger/lumo-npm-example to help anyone else who comes along before there is more documentation. Would appreciate any feedback on what I might got wrong or could have done better! Thanks again for the help, I’m sure I’ll be back with more questions! 🙂

richiardiandrea08:08:57

@rberger that depends on the module, unfortunately the js world is not that straightforward regarding module require. So you required a module that exports a function (constructor) that when called returns the object.

richiardiandrea08:08:23

This is were cljs shines with its namespaces

pesterhazy08:08:19

yeah npm modules often expose a "constructor function"

rb171910:08:32

Hi all. How do you turn off the new rewriting feature as it breaks core.matrix?

dominicm10:08:10

referring to the clojure.core.X becoming cljs.core.X ^^

anmonteiro16:08:55

need more information here

anmonteiro16:08:10

there’s no really turning it off

anmonteiro16:08:19

it might be an upstream bug that needs to be fixed in the compiler

dominicm16:08:57

@anmonteiro it tried to require cljs.core.matrix which doesn't exist

dominicm16:08:10

Core matrix perhaps shouldn't use the clojure prefix.

anmonteiro16:08:54

@dominicm perhaps it’s a classpath problem?

anmonteiro16:08:33

or core matrix is just not self-hosted compat?

anmonteiro16:08:52

CLJS is never going to see that

anmonteiro16:08:58

because it’s defined under a :clj reader conditional

anmonteiro16:08:09

doesn’t seem related to clojure -> clj aliasing at all

dominicm16:08:34

@anmonteiro I think this is related to the change which requires clojure. to cljs.? There is no cljs.core.matrix, clojure.core.matrix is the entry point.

anmonteiro16:08:53

and I just did (require 'clojure.core.matrix)

anmonteiro16:08:02

and it started loading clojure.core.matrix

anmonteiro16:08:15

by that logic we would never be able to require clojure.string or clojure.set

anmonteiro16:08:20

which we can

anmonteiro16:08:52

what may be confusing for you is the error, which says it can’t cljs.core.matrix, could not locate cljs/core/matrix.cljs

anmonteiro16:08:19

but here’s the reason for that to happen: we tried loading clojure/core/matrix.clj* and it failed

anmonteiro16:08:25

so we’ll try the cljs version

dominicm16:08:52

Yeah, that's why I figured it was related to. I also assumed clojurescript had either a whitelist or I should have been using cljs.string the whole time ;)

anmonteiro16:08:28

core.matrix is just not self-host compatible

dominicm16:08:26

Makes sense. A shame it doesn't print everything it tried. I'm also surprised an error loading would cause it to error on found.

dominicm16:08:40

What is the restriction on self host here? What is preventing it from working I mean.

anmonteiro16:08:35

it probably does if you start lumo with -v / --verbose

anmonteiro16:08:13

see the 2 links I pasted above. there’s a macro vector-1d? that’s only defined in :clj

anmonteiro16:08:16

self-host can’t expand it

dominicm16:08:26

(Just comparing to clojure's message there which is could not find x.clj, x.cljc or x.class)

anmonteiro16:08:47

the error message doesn’t really tell you the problem, I’ll give you that

anmonteiro16:08:53

I’ll open an issue

anmonteiro16:08:48

this is perhaps an upstream issue though

dominicm17:08:22

Oh, I see. It's trying to do the self-require thing to get the clojure macros. That's always made my head spin a little. I misread, I thought it was including a cljs compatible version in cljs. And then defining it for clojure.

mfikes17:08:22

Yeah, it falls back from clojure.* to cljs.* but perhaps it should distinguish between absolutely not being able to find the namespace, vs. finding it but having an error loading it.

dominicm17:08:26

Thanks for taking the time to explain it to me. It really helped.