Fork me on GitHub
#shadow-cljs
<
2020-03-18
>
theeternalpulse03:03:49

I'm creating a new project from scratch, and when I try to connect to a clojurescript repl in cider it mentiones "no clojure project detected". Do I need to have something to indicate it's a clojure project?

dpsutton04:03:22

Sounds like an old clojure-mode. Upgrade that to a more recent version that is aware of the shadow project file

theeternalpulse04:03:10

actually I think I got it, was connecting to clojure rather than clojurescript repl

jjttjj15:03:08

Is there an obvious reason https://github.com/hoplon/hoplon/blob/master/src/hoplon/core.clj won't compile with bootstrapped cljs? I tried removing all the java stuff but keep getting

{:error #error {:message Could not require hoplon.core, :data {:tag :cljs/analysis-error}, :cause #error {:message ns hoplon.core not available, :data {:ns hoplon.core}}}}
when i try to compile it (according to this guide (https://code.thheller.com/blog/shadow-cljs/2017/10/14/bootstrap-support.html).

jjttjj15:03:31

Is there a list of rules anywhere on how to make a library bootstrap compatible? Or any general tips for debugging this?

dpsutton15:03:08

does bootstrapped look for clj files at all?

jjttjj15:03:37

I also tried changing to cljc

jjttjj15:03:34

strangely, I have no issues with bootstrapping javelin macros (https://github.com/hoplon/javelin/blob/master/src/javelin/core.clj) directly, even though that's a clj file and has some java calls. But it seems like it's that library (which hoplon also depends on) which I suspect might be giving me the issues when trying to use hoplon. I could be wrong on that though

jjttjj16:03:20

Hmmm I removed all macros from hoplon and even then it doesn't work. (still getting " Could not require hoplon.core"). My bootstrap build looks like

:bootstrap-support
  {:target     :bootstrap
   :output-dir "public/bootstrap"
   :exclude    #{cljs.js}
   :entries    [cljs.js javelin.core cljs.analyzer hoplon.core]
   :macros     []}

thheller19:03:55

@jjttjj looks to me like hoplon macros aren't self-host compatible

jjttjj19:03:52

What makes something not compatible? I removed all java calls

thheller19:03:54

I don't have a clue sorry ... far too complex to do a quick check

jjttjj19:03:00

no problem, thanks!

grav19:03:32

I'm trying to locate a problem with a version of an npm package. I'm running the compiler with npm shadow-cljs watch my-app and then starting node target/main.js Am I right that I only need to restart the node target/main.js part every time I test a different version of the npm package?

thheller19:03:30

if its a node-script build yes

👍 4
jjttjj20:03:35

wait can google closure js libraries effect self-host-ability ?

thheller20:03:50

no. they are already JS

jjttjj23:03:03

Strangely though, javelin and it's macros are working perfectly for me, the io ns is never used in that file. I had a local versiont that got rid of the io require and this line, which I don't think is valid cljs https://github.com/hoplon/javelin/blob/557b51ce14f31c391aefa8a22c8c2aa42db7b269/src/javelin/core.clj#L200 But strangely, after I got that working I went back to using the github/master version and it still worked fine. (I deleted caches several times too)

jjttjj23:03:02

I think I'm just doing something unrelated and dumb because now I keep getting the same error on cljs only projects (even though for some reason javelin still works)

thheller20:03:31

thats one of the namespaces you can't use in self-hosted

David Pham21:03:40

I am trying to use web workers in my workflow, and I am also using day8.re-frame-10x.preload for debugging in my :`preloads`in shadow-cljs. My issue is shadow-cljs might also preload the re-frame-10x in my web workers and it will throw an error because 10xrequires document.

David Pham21:03:19

Does anyone know a solution for this issue? I tried to specify a main and also put the :browser-inject :main as advised in the documentation, but I can't overcome this.

David Pham21:03:36

I found a hack: don't preload it, and require the namespace (require 'day8.re-frame-10x.preload) in the repl after start.

David Pham21:03:30

I don't know how difficult it is, but it could be interesting if we could specify where to inject the preloads similarly to :browser-inject

JAtkins22:03:39

How can I use different stubs for debug and production? By this it looks like it's not possible? https://shadow-cljs.github.io/docs/UsersGuide.html#_clojure_script I'm trying to use [Debux](https://github.com/philoskim/debux), which has sperate deps for production stubs and development tracing.