cljsrn

https://github.com/drapanjanas/re-natal | https://github.com/drapanjanas/re-natal/wiki/FAQ | https://github.com/condense/mercury-app/wiki | https://github.com/seantempesta/expo-cljs-template/ https://www.npmjs.com/package/create-expo-cljs-app
Stefan 2021-06-09T09:21:13.114200Z

Hi! I’m looking for some opinions from y’all. We have a quite outdated react native app, that desparately needs to be modernized. I’m wondering whether to go the Krell route, or use shadow-cljs (possibly combined with helix). Can I get some pro’s and cons from you? Things that are important to me is integration with Calva, developer experience in general, easy upgradability, and easy use of community packages, both those for RN and generic npm. Really looking forward to your insights!

kennytilton 2021-06-10T10:22:04.119500Z

Reagent suffers from glitches, FWIW.

Stefan 2021-06-10T10:25:49.119700Z

@hiskennyness What kind of glitches are you referring to?

kennytilton 2021-06-10T10:32:52.119900Z

If you set up the subscriptions a certain way, we see a single initial state change propagate twice to some final subscription. This is the classic "glitch" in reactive programming, where the final dependency has two paths thru the dependency graph to some original node. https://en.wikipedia.org/wiki/Reactive_programming#Glitches

👍 1
kennytilton 2021-06-10T10:36:08.120200Z

re-frame de-dups the dependency graph so it avoids glitches, or at least I was unable to force one. I ran into glitches in my own Cells/Matrix code when implementing a RoboCup client, which was a brutal use case because all dataflow ran from a single node in which a new game update was received. It totally broke the app.

👍 1
kennytilton 2021-06-10T10:41:56.120400Z

ps. Yes, I was able to force a glitchy behavior in Reagent. Reported it in that channel ages ago.

pez 2021-06-10T11:59:15.121Z

For other reasons I would still be building using re-frame if I use Reagent.

pez 2021-06-09T09:23:59.114800Z

Is Expo an option? If that you should have that in the mix of options as well. 😃

dotemacs 2021-06-09T09:26:17.115Z

I suspect that your choices are more going to be based on your preference rather than some technical issue.

Stefan 2021-06-09T09:28:46.115200Z

@pez Nope, Expo is not an option.

Stefan 2021-06-09T09:28:59.115400Z

@dotemacs So what’s yours, and why? 🙂

dotemacs 2021-06-09T09:30:37.115600Z

I like shadow-cljs because it just works. Sticking to it because you can use it for plain cljs projects.

🙏 1
dotemacs 2021-06-09T09:31:24.115900Z

Nothing wrong with Krell either, but I was using shadow-cljs before Krell came out. So I guess you can say that familiarity with it sways me.

Stefan 2021-06-09T09:31:46.116100Z

Yeah that makes sense.

pez 2021-06-09T09:32:40.116300Z

Since you are a Calva user you already reveal that the purity of each tool doing just one thing is not your primary selection criteria. 😃

pez 2021-06-09T09:33:52.116500Z

The shadow-cljs inspector is totally wonderful. I tap> like crazy these days.

❤️ 2
Stefan 2021-06-09T09:38:48.116700Z

I guess I’m pretty pragmatic in that respect 🙂 And indeed, shadow-cljs’s tap inspector is very convenient. Also head about djblue/portal today by the way, will have to check that out as well, sounds interesting.

pez 2021-06-09T09:40:30.116900Z

One thing I missed from figwheel was that it reports which files are being reloaded. Thomas Heller helped me figuring out a build hook for that:

(defn print-compiled-files
  {:shadow.build/stages #{:flush}}
  [{:keys [build-sources] :as build-state}]
  (let [compiled
        (get-in build-state
                [:shadow.build/build-info
                 :compiled])
        output
        (->> rc
             :resource-name
             (for [src-id build-sources
                   :when (contains? compiled src-id)
                   :let [rc (get-in build-state
                                    [:sources src-id])]])
             (sort)
             (into [:compiled]))]
    (binding [clojure.pprint/*print-right-margin* 20]
      (clojure.pprint/pprint output)))
  build-state)

👍 1
Stefan 2021-06-09T09:42:52.117200Z

Did you really mean “figwheel” just now, or shadow-cljs? @pez

pez 2021-06-09T09:43:20.117500Z

I meant that figwheel does this, but shadow doesn’t, out of the box.

Stefan 2021-06-09T09:44:31.117700Z

Ah right 👍

pez 2021-06-09T09:45:33.117900Z

Regarding helix, there was some discussion in #clojure-europe yesterday regarding frontend frameworks. Some good arguments for Reagent where posted.