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
raspasov 2021-06-17T01:12:49.154Z

@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.

raspasov 2021-06-17T01:13:49.155Z

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.moon 2021-06-17T04:28:51.157500Z

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.moon 2021-06-17T04:30:15.158800Z

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

woonki.moon 2021-06-17T04:44:41.160600Z

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.moon 2021-06-17T04:46:08.162200Z

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 <http://192.20.22.134:8081/target/goog/dom/tagname.js> [SyntaxError: 9:20:Invalid expression encountered]
 ERROR  Could not evaluate <http://192.20.22.134:8081/target/goog/html/safescript.js> [SyntaxError: 14:1:invalid statement encountered.]
 ERROR  Could not evaluate <http://192.20.22.134:8081/target/goog/html/trustedresourceurl.js> [SyntaxError: 17:32:Invalid expression encountered]
 ERROR  Could not evaluate <http://192.20.22.134:8081/target/goog/html/safeurl.js> [SyntaxError: 16:21:Invalid expression encountered]
 ERROR  Could not evaluate <http://192.20.22.134:8081/target/goog/html/safestyle.js> [SyntaxError: 14:23:Invalid expression encountered]
 LOG  Connected to Krell REPL Server
 ERROR  Could not evaluate <http://192.20.22.134:8081/target/goog/html/safestylesheet.js> [SyntaxError: 17:1:invalid statement encountered.]
 ERROR  Could not evaluate <http://192.20.22.134:8081/target/goog/html/safehtml.js> [SyntaxError: 25:22:Invalid expression encountered]
 ERROR  Could not evaluate <http://192.20.22.134:8081/target/goog/math/long.js> [SyntaxError: 11:1:invalid statement encountered.]

woonki.moon 2021-06-17T11:47:00.164500Z

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

dnolen 2021-06-17T12:05:50.165300Z

@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

dnolen 2021-06-17T12:06:01.165600Z

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

woonki.moon 2021-06-17T12:11:44.165800Z

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?

dotemacs 2021-06-17T14:00:50.166Z

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

dnolen 2021-06-17T14:01:29.166400Z

Hermes is just busted

dnolen 2021-06-17T14:01:41.166700Z

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

👍 4
dnolen 2021-06-17T14:02:31.167300Z

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

dnolen 2021-06-17T14:02:36.167500Z

never again

dotemacs 2021-06-17T14:03:36.167700Z

Thanks for sharing

raspasov 2021-06-17T14:08:27.168Z

That’s very good to know re: Hermes.

woonki.moon 2021-06-17T14:21:51.168500Z

good to know that. Thanks!

Michael Jung 2021-06-17T20:47:19.173400Z

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

👌 1
dnolen 2021-06-17T23:28:00.175Z

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

woonki.moon 2021-06-17T23:55:33.175100Z

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