Fork me on GitHub
#re-frame
<
2018-05-09
>
jco10:05:10

Hi, this might have been asked and answered before, but my Googling led me nowhere, so here goes: Can re-frame be used for making desktop applications? Would you need something like Electron to make this happen?

danielneal10:05:21

I think I read somewhere that the team behind reframe do use it for desktop applications...

soulflyer10:05:53

I'm working on a re-frame based app right now. I used descjop for the electron part and I have an example project including re-frame here if it's of any help https://github.com/soulflyer/electron-re-frame-example

👍 4
jco10:05:14

How do you find the experience? Is it as nice as re-frame on a web-page?

soulflyer08:05:10

It all seems to work fine. No real surprises. But then electron is pretty much just chrome with a new suit on....

jco09:05:19

Cool. Have you figured out how to best call the Clojure backend using this setup? Is there even a Clojure backend (I'm slightly confused by all the moving parts)? In a "conventional" web app I'd use a HTTP call to the Clojure server...

soulflyer09:05:15

I have an entirely separate backend written as a luminus project that provides an api. There's probably a better way, but I like the separation.

👍 4
tianshu16:05:31

I found it annoying for overwriting reg-event or reg-sub warnings when use hot-reload. how can I get rid of it?

kenny16:05:00

@doglooksgood We use this:

(re-frame.loggers/set-loggers!
  {:warn (fn [& args]
           (cond
             (= "re-frame: overwriting" (first args)) nil
             :else (apply js/console.log args)))})

tianshu16:05:31

@kenny thanks, but why not a built-in function for this. I think this is a very common issue.

kenny16:05:14

There would need to be a general way to detect when a reload is happening. The latest version of shadow-cljs and figwheel provide this (I think). You're welcome to vote on the issue here: https://github.com/Day8/re-frame/issues/204.

👍 4
tianshu17:05:58

I'm trying to use re-frame-10x in react-native, almost everything works, the only problem is fx, app-db, subs are showing me the previous state, not current state. only trace show me all the traces. is it a bug or something I missed?

hoopes19:05:29

@doglooksgood are there instructions you followed to get it running that are different than https://github.com/flexsurfer/re-frisk/wiki/Using-re-frisk-with-re-natal ? I haven't been able to get this over the hump yet.

danielcompton21:05:22

@doglooksgood ah, I think I might know why that would be

danielcompton21:05:44

re-frame-10x detects the end of a render cycle by waiting for Reagent to stop rendering, or for a new event to come through, and that via a monkeypatched function in Reagent

danielcompton21:05:09

How does React Native render? I confess I don't even know if it uses Reagent/React to render to a DOM or whether it actually renders real native Cocoa/Android elements?