This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-01
Channels
- # beginners (133)
- # boot (59)
- # cider (5)
- # cljs-dev (30)
- # cljsrn (23)
- # clojure (212)
- # clojure-austin (3)
- # clojure-brasil (1)
- # clojure-chicago (5)
- # clojure-italy (10)
- # clojure-russia (5)
- # clojure-serbia (1)
- # clojure-spec (34)
- # clojure-turkiye (2)
- # clojure-uk (132)
- # clojurescript (163)
- # clojutre (1)
- # cursive (5)
- # datomic (58)
- # emacs (42)
- # events (1)
- # graphql (26)
- # hoplon (16)
- # jobs (1)
- # lumo (27)
- # numerical-computing (3)
- # off-topic (127)
- # om (9)
- # onyx (24)
- # re-frame (20)
- # reagent (20)
- # ring-swagger (14)
- # sql (19)
- # unrepl (28)
- # untangled (3)
- # vim (8)
- # yada (17)
@anmonteiro Let me explain what I mean by “skip requiring a ns”. I am using lumo to generate the analysis cache of some namespaces. For instance, for generating the analysis cache for reagent, I am running:
lumo -k /path/to/cache
and inside lumo: (require 'reagent)
reagent requires ‘cljsjs.react and currently in lumo 1.5 it doesn’t work
I was thinking about skipping cljsjs.react as it is not really needed for the analysis cachewhat you’re saying doesn’t make a lot of sense
simply because you might get corrupted analysis cache
that said, you can probably doing it by messing with the internals of the CLJS compiler
@viebel specifically, by doing something like (swap! cljs.js/*loaded* conj 'cljsjs.react)
I just did it here and it skipped
I don’t even have cljsjs.react
in my classpath and require
succeeded
however, note that you’re on your own once again 🙂
Thanks @anmonteiro. I see how in the general case, marking a ns as already loaded might corrupt the analysis cache. Do you think that in the case of a cljsjs lib it could also happen?
JavaScript foreign libraries don’t add anything to the analysis cache, so no
Another question: I’m trying to (require 'day8.re-frame.http-fx)
and it fails on XMLHttpRequest is not defined
that comes down to this line: https://github.com/JulianBirch/cljs-ajax/blob/master/src/ajax/xml_http_request.cljs#L12-L17
but when I am executing
(def xmlhttprequest
(if (= cljs.core/*target* "nodejs")
(let [xmlhttprequest (.-XMLHttpRequest (js/require "<@U071MQNLR>/xmlhttprequest"))]
(goog.object/set js/global "XMLHttpRequest" xmlhttprequest)
xmlhttprequest)
(.-XMLHttpRequest js/window)))
I am getting another error Cannot find module '<@U071MQNLR>/xmlhttprequest'
inside lumo, cljs.core/*target*
is “nodejs” right?
Is it the same also during the analysis phase?
@viebel sure, did you npm install <@U071MQNLR>/xmlhttprequest
?
Is there a way to install an npm package from the project.clj
?
that’s not really a Lumo question
I don’t use Lein
Yeah. makes sense
Another question @anmonteiro : is clojure.edn
available in self-host env?
no, but there’s cljs.tools.reader
Oh yeah. I forgot about it