Fork me on GitHub

Has anyone had any success with connecting an electron app to the fulcro ispect app?


This is my shadow-cljs build config

:builds {:desktop-main {:target :node-script
                        :output-to "resources/main.js"
                        :main app.desktop.main.core/main}

         :desktop-renderer {:target :browser
                            :output-dir "resources/public/js"
                            :asset-path "js"
                            :modules {:renderer {:init-fn app.desktop.renderer.core/init}}
                            :js-options {:keep-native-requires true
                                         :extensions [".web.js" ".js" ".json"]
                                         :resolve    {"react-native" {:target :npm
                                                                      :require "react-native-web"}}}
                            :dev        {:closure-defines {com.fulcrologic.fulcro.inspect.inspect_ws/SERVER_PORT 8237}}
                            :devtools   {:preloads [com.fulcrologic.fulcro.inspect.websocket-preload]}}}}


I'm currently getting this error ^


Ahhh, I'm guessing this has to do with the fact that electron grabs the app via "file://" and not an http server...


Has anyone worked around this?


Looking at the source we could pass in

:protocol       ; Server protocol, e/o #{:http :https}.
to sente/make-channel-socket-client!


@mruzekw Ah interesting…don’t think I had tried that


there are instructions for building inspect in the inspect repo..feel free to tinker. Be careful about pinning it to one value, though. If websocket is used in browser, it would have to adapt between http and https (I think? mixed content policy?)


Okay, thanks, will give it a try. I'll send a PR if I get something working


@U0CKQ19AQ Figured out com.taoensso/sente 1.15.0 doesn't respect the host param, but v1.16.0-alpha1 does. And it works! I'll use that locally until you decide to bump it in fulcro


ah, great. thanks. So just the version bump does it?


yeah, my collaborator currentoor sent that patch…I’m aware of the problem…just didn’t think about it w/respect to your issue


because you were talking protocol, not host


Oh, hmm, let me double check, because I was overriding fulcro to a local version as well


Okay, yes, providing a protocol does matter, otherwise it will pull what's in the window location


In my test I provided :http and it worked


But as you said, we should probably account for either? And if file: feed it one or the other?


--- a/src/main/com/fulcrologic/fulcro/inspect/inspect_ws.cljs
+++ b/src/main/com/fulcrologic/fulcro/inspect/inspect_ws.cljs
@@ -35,6 +35,11 @@
         {:type           channel-type
          :host           SERVER_HOST
          :port           SERVER_PORT
+         :protocol       (let [enc-protocol (:protocol (enc/get-win-loc))]
+                           (cond
+                             (= enc-protocol "http:") :http
+                             (= enc-protocol "https:") :https
+                             :else :http))
          :packer         (make-packer {:read  inspect.transit/read-handlers
                                        :write inspect.transit/write-handlers})
          :wrap-recv-evs? false


This is the patch I'm thinking. Match up http and https if that's the case, otherwise default to http


Another option might be to have a fulcro starter for electron using ses.loadExtension(path) to load fulcro-inspect as a chrome extension


@U0CKQ19AQ Let me know your thoughts on the above when you have a moment.


I had this scenario which I am not able to reason about. I was doing a mutation which performed a datomic operation. However because the result of the datomic operation was being returned, transit was failing to serialize it and threw an error. However interestingly the datomic transaction did not go through, the wite did not succeed because transit serialization was failing. That doesnt make sense, why would datomic transaction not commit, if a subsequent expression (transit serialization in the ring middleware) was failing ?

Jakub Holý (HolyJak)15:05:37

If it doesn't make sense then perhaps it is not what is truly happening? Could you be getting 2 separate transit errors?


Workspaces is currently broken, is that correct? I get TBD, classpath indexing is gone.


oh. I forgot that workspaces has a custom shadow-cljs target. that needs to be updated.


To anyone who want’s to join our little fulcro study group, we’re meeting in around 30 mins =)…


Pinging you @U0522TWDA as you’ve expressed interest =)…

Jakub Holý (HolyJak)10:05:18

Thanks! Unfortunately we have a work meting at 13 😞 Next time!

Chris O’Donnell11:05:19

Going to restart my computer @U0JUM502E, issue is not only hangouts


Cool 😃… See you soon!


is there a way to follow this study group? I'm a newbie in fulcro and would love to see how you guys/gals approach the learning process for it


Well you can join our calls?


I would be really interested too, can we get meeting invites?


No problem =)… I usually just update a thread like this with a link like I’ve done previously =)… I’m keeping it low touch as I don’t want to bug people who aren’t really interested any more… I’ll @ anyone who’s asked next week when I put a new call link up!

🙏 8

Hey, Just a heads up that we’ll be having our call in a bit to anyone who can join. Pinging those who’ve expressed interest =)… @U0522TWDA @U0DUNNKT2 @U04VBBS6N @U014BBTEFK6


We’ll be starting in 30 mins =)…

Jakub Holý (HolyJak)12:06:34

Sorry, mobprogramming day at work


ah it looks like we are on different time zones 😞. thanks for the heads up


Sorry :(… To be fair today was really quick because there was just two of us this time… We’re not too strict with a fixed time as sometimes people need 10 mins or more to wrap something up. I’ll do the heads up again next week!


no worries, understandable. thank you!


Yea it works "the oldschool way" (though I have a bunch of other problems, but oh well)


sorry about that. I'll see if I can put together a PR for this later if I have some time


👍 it is a minor thing really, but if that is something that needs more time, maybe it should be mentioned in the readme


When I have ::f.portal/wrap-root? set to true, my component doesn't get rendered at all, only when I set it to false.

Björn Ebbinghaus16:05:08

I used the react components in the last days and decided to bundle the fulcro wrappers in a lib: They are far from complete, I only added what I needed. Feel free to extend. They are using reader conditionals for when someone is writing SSR compatible components. (they are emitting nil in that case)

🎉 24