Good morning, @smith.adriane — you had written: https://clojurians.slack.com/archives/C073DKH9P/p1594624478416900?thread_ts=1594229800.342600&channel=C073DKH9P&message_ts=1594624478.416900
Can you help me understand this better? When I think of hot code reloading, I usually think of something like figwheel or shadow-CLJS that is watching the filesystems, and automatically reloading the code when it changes. Are you suggesting that there's some way to do this with membrane? Even if not, I found myself quitting my membrane app (by clicking on the close window icon) whenever I had made a change to the program — is there a better way to do this? (Maybe I just need to have the app re-render the UI upon code changes somehow?) @smith.adriane
it depends on which editor you use. on the jvm, most editors allow you to spin up a repl and sent expressions to the repl to be reevaluated.
I use emacs +cider/nrepl. My workflow is to typically run a window with the component I'm working on and use cider-eval-defun-at-point
to update the ui as I'm working on it
Yep, I'm using Cursive/IntelliJ, and had the REPL reloading modified files. Is there a way I can tell the membrane app to re-render the views, or in the more extreme case, restart the application (without having to mouse over to manually close the app window)?
the window should rerender whenever an event occurs or 0.5 seconds
as long as your main is calling a function that can be redefined
for example:
(defn my-app []
(on
:key-press
(fn [s]
(spit "test.log" (str "keypress: " s "\n") :append true)
[[:keydown s]]
)
(ui/label "hello world4")))
(defn -main [& args]
(dispatch [:initialize-db])
(skia/run #(memframe/re-frame-app (#'my-app))))
you can then update my-app
and see the changes
Oh! I'll check again — and holy cow, I didn't think of the possibility of running different windows to render isolated components. Very cool. (Gotta take a break to get some real work done today. But I'll be thinking about this all day long! :) Thx again!
I just edited the example (it was missing #'
to make sure it gets the latest version of my-app
Inviting @logbot, to ensure that this channel gets into the Clojurians Slack Archive.