Fork me on GitHub
#shadow-cljs
<
2020-03-29
>
knubie00:03:57

Ok I’ll give that a try thanks

hulunote10:03:35

when i use the command clojure -A:cider:cljs:shadow watch jarvis , it’s will build success.

hulunote10:03:08

but i use the M-x cider-jack-in-cljs => chose shadow-cljs => chose :jarvis , i will get this Error: Build failure , The required namespace “shadow.remote.runtime.cljs.browser” is not available.

hulunote10:03:22

this is my shadow-cljs.edn file:

{:deps   {:aliases [:cljs]}
 :builds {:jarvis {:target :browser
                   :output-dir "resources/public/js"
                   :modules
                   {:jarvis {:init-fn functor-api.core/init!}}
                   :devtools
                   {:http-port  8801
                    :http-root  "resources/public"
                    :after-load functor-api.core/mount-components
                    :preloads   [shadow.remote.runtime.cljs.browser]}}

          :test {:target   :browser-test
                 :test-dir "src/test/resources/public/js/test"
                 :devtools
                 {:http-port 8821
                  :http-root "src/test/resources/public/js/test"}}}}

thheller10:03:36

which shadow-cljs version do you use? in the deps.edn file?

thheller10:03:28

I don't know anything about cider so can't help much in that regard

Ahmed Hassan10:03:37

shadow.remote.runtime.cljs.browser what is this preload?

hulunote10:03:13

@thheller it’s my dep.edn

thheller10:03:17

try version 2.8.94. the version you have didn't have that ns

hulunote10:03:32

@thheller build failure again.

dpsutton14:03:05

If you’re on the latest cider the repl buffer should have the commands it’s running to get everything set up

dpsutton14:03:16

couple questions for you though. When running this from the command line I see you use the shadow-cljs alias. Are you adding this to the startup command when cider-jack-in?

dpsutton15:03:12

i walked through an example here with thoughts:

hulunote22:03:40

Thanks 👍 , when i use clojure -A:cider:cljs:shadow watch jarvis , then i cider-connect-in-cljs , it’s work require shadow.remote.runtime.cljs.browser.

thheller10:03:16

sorry I can't tell what cider is doing so I can only help with actual shadow-cljs output

Quentin Le Guennec11:03:29

Hi, is there a way to access the clojurescript compiler from a shadow project? I need to add a onclick handler to a DOM node (`onclick="console.log('hi')"`), for that I would need: (compile '(.log js/console "hi")

thheller14:03:23

@quentin.leguennec1 that is not supported and not a good idea either

Quentin Le Guennec14:03:09

I found another way around, by the way. Attaching an event works, no need for an onclick attribute

thheller14:03:26

yes, attach event handlers via code and not via html

Quentin Le Guennec14:03:45

I think that's what react does

Quentin Le Guennec14:03:12

I'm trying to rewrite react