Fork me on GitHub
#shadow-cljs
<
2020-06-20
>
rberger08:06:53

I have a local file JS import: ["./antmedia/webrtc_adaptor.js" :refer [WebRTCAdaptor]] Its working fine. The file is being imported and all the functionality is there. The issue is that, In dev mode, if I make changes to that JS file, shadow-cljs doesn’t seem to notice and doesn’t do a rebuild. Is that expected behavior? Or am I doing something wrong? I also tried putting it in a parallel directory as per https://shadow-cljs.github.io/docs/UsersGuide.html#_requiring_js (and modified the :require statement to match) and it again worked correctly if I restarted shadnow-cljs watch but shadow-cljs still did not rebuild when I changed something in the js file.

rberger08:06:13

Its doing this with shadow-cljs 2.10.9 and 2.10.12

David Pham09:06:03

Where is the tap> feature documented?

David Pham09:06:48

How can you use the inspect feature of shadow-CLJS with regular Clojure?

David Pham09:06:49

Got it in my notes haha

David Pham09:06:52

(require '[shadow.cljs.devtools.server :as server])
(server/start!)
(tap> :hello)

currentoor23:06:52

I'm developing an app in chrome but over LAN on a mobile device, using the setting in shadow-cljs.edn

:log      {:level :debug}
my runtime keeps disconnecting from shadow and I see this log
[2020-06-20 15:59:27.446 - FINE] :shadow.remote.relay.local/client-disconnect - {:client-id 52, :client-info {:since #inst "2020-06-20T22:59:07.397-00:00", :proc-id "d6e4f00e-4f36-442d-a752-0894a052b5f0", :connection-info {:remote true, :websocket true}, :user-agent "Chrome 537.36 [Linux armv8l]", :type :runtime, :lang :cljs, :build-id :back-office, :host :browser, :dom true}}
but looking at the remote chrome devtools network tab i see a sente websocket connection to my server remains robust but but the shadow connection keeps dieing, any ideas why?

currentoor23:06:36

the message frames for the shadow WS connection always look like this, before dying

["^ ","~:op","~:welcome","~:client-id",47]
["^ ","~:op","~:hello","~:client-info",["^ ","~:host","~:browser","~:user-agent","Chrome 537.36 [Linux armv8l]","~:dom",true,"~:type","~:runtime","~:lang","~:cljs","~:build-id","~:back-office","~:proc-id","d6e4f00e-4f36-442d-a752-0894a052b5f0"]]
["^ ","~:op","~:request-notify","~:notify-op","~:shadow.cljs.devtools.client.env/worker-notify","~:query",["~:eq","~:shadow.cljs.model/worker-for","~:back-office"]]
["^ ","~:op","~:request-supported-ops","~:from",3]
["^ ","~:op","~:supported-ops","~:ops",["~#set",["~:ping","~:shadow.cljs.devtools.client.env/worker-notify","~:tap-unsubscribe","~:obj-forget","~:cljs-asset-update","~:cljs-build-start","~:runtime-print-unsub","~:obj-describe","~:cljs-build-complete","~:cljs-eval","~:tap-subscribe","~:request-tap-history","~:obj-request","~:cljs-build-failure","~:obj-forget-all","~:js-eval","~:shadow.cljs.devtools.client.shared/runtime-print-disconnect","~:runtime-print-sub","~:cljs-runtime-init","~:cljs-build-configure","~:access-denied"]],"~:to",3]    539    
["^ ","~:op","~:tap-subscribe","~:summary",true,"~:history",true,"~:from",3]
["^ ","~:op","~:tap-subscribed","~:history",[],"~:to",3]

currentoor23:06:33

reading the shadow source and these messages, it looks like the server sends a :ping and the client is supposed to respond with a :pong https://github.com/thheller/shadow-cljs/blob/5a32abb215c81c26268967ed4439303bb348e5d0/src/main/shadow/cljs/ui/worker/relay_ws.cljs#L90 but in these messages the client is never sending the :pong, nor do I see any error messages in the logs

currentoor23:06:37

is there anyway to get more insight into why this might be happening?

currentoor23:06:53

in the messages for sente, I see sente just sends a ping to the server every 20 seconds, would that design be more robust? rather than having the client wait for the server to tell it to ping/pong, just have the client ping on some regular interval

currentoor23:06:37

not having my usual shadow-cljs repl is really hindering progress

thheller23:06:52

@currentoor the server sends the ping every 5sec, not sure why it wouldn't. too tired to look into this now. would help if you have something reproducible.

donyorm23:06:26

Anyone have any wisdom/advice for deploying shadow-cljs apps to heroku? Or suggestions for an alternative to heroku that works well with clojurescript (currently just have a frontend so no worry about setting up a backend yet)

dpsutton23:06:50

if no backend i've found netlify to be extremely easy

dpsutton23:06:37

https://github.com/dpsutton/asg-ignite-presentation has an example app, a presentation going through the app, and a link to the app running on netlify

donyorm23:06:25

Thanks that's helpful.!