Fork me on GitHub
#cljsrn
<
2021-06-17
>
raspasov01:06:49

@michael.w.jung “Do you simply have a conditional in your root component that will show the proper subcomponent depending on your application state?” Yes! That’s what I do.

raspasov01:06:49

I very much share dnolen’s skepticism of router frameworks. Too much buy-in for my taste. Your whole application and every component becomes dependent on them.

woonki.moon04:06:51

Hi, I'm trying the Krell, but I can't figure out how to connect rn and cljs actually. I've followed the tutorial https://github.com/vouch-opensource/krell/wiki/Reagent-Tutorial I can't continue to the next step after running the build command and seeing waiting for device connection on port 5001.

woonki.moon04:06:15

The metro bundler is running on 8081, and successfully running a build the rn itself on device.

woonki.moon04:06:41

Never mind. It was the matter of time and the order of running commands. After several tries, I finally see the Hello Krellmessage on the device. :thumbsup:

woonki.moon04:06:08

But the metro bundler is complainning about these error messages when I start running the repl. Is it okay to ignore it or should I fix something?

ERROR  Could not evaluate  [SyntaxError: 9:20:Invalid expression encountered]
 ERROR  Could not evaluate  [SyntaxError: 14:1:invalid statement encountered.]
 ERROR  Could not evaluate  [SyntaxError: 17:32:Invalid expression encountered]
 ERROR  Could not evaluate  [SyntaxError: 16:21:Invalid expression encountered]
 ERROR  Could not evaluate  [SyntaxError: 14:23:Invalid expression encountered]
 LOG  Connected to Krell REPL Server
 ERROR  Could not evaluate  [SyntaxError: 17:1:invalid statement encountered.]
 ERROR  Could not evaluate  [SyntaxError: 25:22:Invalid expression encountered]
 ERROR  Could not evaluate  [SyntaxError: 11:1:invalid statement encountered.]

woonki.moon11:06:00

Is it possible to use the 10x dev tool with Krell + re-frame? or any other recommended dev tool such as 10x?

dnolen12:06:50

@woonki.moon we load ClojureScript files through Metro so that is a bit odd - you should paste those urls into the browser and confirm they look ok

dnolen12:06:01

make sure you are not using Hermes - it's totally broken IMO

woonki.moon12:06:44

Oh, actually I'm using the hermes. I think I should test it after turning off. Is it okay to turn it enabled when I build it for production?

dotemacs14:06:50

Hey @dnolen do you mind sharing some more details on Hermes and the issues you came across? Thanks

woonki.moon23:06:33

The error messages are gone now when I turned the hermes off. Thanks!

dnolen14:06:29

Hermes is just busted

dnolen14:06:41

it lags behind the JS language spec - I would not use it

👍 8
dnolen14:06:31

we did use it and than ran into the same problem - took a while to figure it out

dnolen14:06:36

never again

dotemacs14:06:36

Thanks for sharing

raspasov14:06:27

That’s very good to know re: Hermes.

woonki.moon14:06:51

good to know that. Thanks!

Michael Jung20:06:19

@raspasov I definitely can relate to that. I’m not too happy with it either. But I like the idea of having a look & feel as close to native as possible. So far I was able to keep it out of my components pretty well as I hid it using re-frame effects. @dnolen I’ve found some articles that claim to have a solution to hot reloading with react (native) navigation. They make use of some special lifecycle functions in shadow-cljs like in the following example:

(defn ^:dev/after-load start []
  (js/console.log "start"))

(defn init []
  (js/console.log "init")
  (start))

;; optional
(defn ^:dev/before-load stop []
  (js/console.log "stop"))
Where init is called once, start is called after every hot reload, and stop before the hot reload is applied. Can we do something similar with Krell?

👌 2
dnolen23:06:00

it's worth considering but I'd like to hear an explanation of why this solves the issue?