Oh cool will need to check that out.. thanks!
There's something in pedestal for this
@dominicm do you mean this? https://github.com/pedestal/pedestal/blob/master/service-tools/src/io/pedestal/service_tools/dev.clj#L23
Yeah!
@dimovich @thiru0130 thanks
Hi Guys, has anyone experimented with setting up electronjs
with figwheel-main
- it'd be nice if you could share a link or some guidance here 🙂
Ok, what I did was to create a JS project that would only load the Electron env, and activate node integration: https://github.com/mauricioszabo/repl-tooling/blob/master/integration.js Then I've configured a browser target: https://github.com/mauricioszabo/repl-tooling/blob/master/shadow-cljs.edn.
When I need to require things, I've used (js/require "my-dependency")
for example. There's a configuration for shadow-cljs to resolve these things to you so you can use the namespace format too
For example, you can configure a :browser target and add the configuration :js-options {:js-provider :require}
inside the browser target, so it'll emit require(...)
commands on the JS side
Hmm, this seems nice @mauricio.szabo thanks for taking the time to look into it man 👍 ! Let me explore this direction more over the weekend.
OMG.
Perfect!
@abhi18av I am no expert, but it seems shadow-cljs may be easier for combining electronjs
and ClojureScript.
I saw a few figwheel related articles when googling cljsjs electron
. Cljsjs doesn't seem to have electron, but it sounds like someone has packaged electron up as a foreign lib with externs themselves.
Ah yes, looking through https://shadow-cljs.github.io/docs/UsersGuide.html there is quite a bit to set up. I wonder if anyone has created a project template. I am interested in setting up shadow-cljs with the Clojure CLI tools (deps.edn) and getting that to all run from CIDER. I'll try find a day to work on that but it will be after my charity ride (so late September).
If you can find a working electron via Cljsjs, that should be easier, just adding it as a dependency to your figwheel project. You may want to avoid advanced compilation if you are getting a lot of errors.
There is a new article about shadow-cljs that looks interesting https://code.thheller.com/blog/shadow-cljs/2019/08/25/hot-reload-in-clojurescript.html
Thanks for always being so helpful @jr0cket 😊 ! Let me give some time to this setup sometime this week and circle back to you on the progress, the article does clear out a few doubts I had about the reloadable code, which is ideally what we want in the electron-cljs
workflow as well
I have an electron app with shadow-cljs, if you need any help :)