Fork me on GitHub
#shadow-cljs
<
2022-04-13
>
oly10:04:14

Hi is there a way to make shadow watch certain folders, I am finding the hot reload works for some files but not others, I am using local/repo in my deps files which may be related which uses relative paths. so my classpath looks like this ["src" "resources" "../../components/web-ui"] shadow does not detect changes in /web-ui with out a f5 refresh relativly new to shadow so this may be a simple answer šŸ™‚

oly11:04:01

On save I do get the reload icon it seems like its just not rebuilding the files in web-ui folder

oly11:04:10

never mind I forgot the ^:dev/after-load on the render call šŸ˜•

Ted Ciafardini15:04:16

been there:sunflower:

FlavaDave20:04:44

I have an electron app built with shadow based on https://github.com/BTowersCoding/electron and can only seem to import modules from electron in my main process and not my renderer. in main i have ["electron" :refer (app BrowserWindow crashReporter dialog)] and everything in there works fine. But when I import in the renderer like ["electron" :refer (remote)] it always breaks. I tried looking at a bunch of different electron examples because i originally thought I was (and perhaps still am) miss-using the electron library but now Iā€™m starting to wonder if my shadow configuration is messed up.

FlavaDave20:04:14

I referenced here https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages and tried a few different ways of importing but was not successful

FlavaDave20:04:00

{:source-paths
 ["src"]

 :dev-http {8080 "resources/public/"}

 :dependencies
 [[reagent "1.1.0"]
  [re-frisk "1.5.2"]
  [re-frame "1.2.0"]
  [thheller/shadow-cljs "2.17.8"]]

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

          :renderer {:target     :browser
                     :output-dir "resources/public/js"
                     :asset-path "js"
                     :devtools   {:watch-dir "resources/public"
                                  :preloads  [re-frisk.preload]}
                     :modules    {:renderer {:init-fn app.renderer.core/start!}}}}}

Fahd El Mazouni05:04:36

Hi ! This is an electron thing, you need to configure your window ( getting spawned in the main process ) to expose the node stuff, sorry I don't remember exactly what it was. I do remember that remote is deprecated though, so maybe try to use exposeinmainworld https://www.electronjs.org/docs/latest/api/context-bridge

thheller05:04:19

yeah, electron has changed a lot and most templates that exist have not been updated to how you are supposed to do things nowadays

FlavaDave17:04:41

Thanks yall!