membrane

genekim 2020-07-13T15:28:44.000200Z

@genekim has joined the channel

phronmophobic 2020-07-13T15:33:10.000300Z

set the channel topic: https://github.com/phronmophobic/membrane

genekim 2020-07-13T15:45:42.004300Z

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

phronmophobic 2020-07-13T15:50:22.005Z

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.

phronmophobic 2020-07-13T15:52:26.006600Z

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

wasser 2020-07-13T15:56:32.006800Z

@wasser has joined the channel

genekim 2020-07-13T16:01:15.009600Z

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)?

phronmophobic 2020-07-13T16:02:48.010100Z

the window should rerender whenever an event occurs or 0.5 seconds

phronmophobic 2020-07-13T16:03:37.011200Z

as long as your main is calling a function that can be redefined

phronmophobic 2020-07-13T16:04:32.012100Z

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))))

phronmophobic 2020-07-13T16:04:44.012400Z

you can then update my-app and see the changes

genekim 2020-07-13T16:05:03.012800Z

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!

euccastro 2020-07-13T16:05:55.013100Z

@euccastro has joined the channel

phronmophobic 2020-07-13T16:07:09.014Z

I just edited the example (it was missing #' to make sure it gets the latest version of my-app

genekim 2020-07-13T16:26:32.015300Z

That worked! So cool! I’m ridiculously happy about seeing my changes reflect in the UI.

genekim 2020-07-13T16:08:16.014700Z

Inviting @logbot, to ensure that this channel gets into the Clojurians Slack Archive.

👍 1
logbot 2020-07-13T16:08:19.014900Z

@logbot has joined the channel

2020-07-13T16:20:41.015200Z

@thegeez has joined the channel

rberger 2020-07-13T21:07:51.015700Z

@rberger has joined the channel