@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.
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.
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
.
The metro bundler is running on 8081, and successfully running a build the rn itself on device.
Never mind. It was the matter of time and the order of running commands. After several tries, I finally see the Hello Krell
message on the device. :thumbsup:
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.]
Is it possible to use the 10x dev tool with Krell + re-frame? or any other recommended dev tool such as 10x?
@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
make sure you are not using Hermes - it's totally broken IMO
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?
Hey @dnolen do you mind sharing some more details on Hermes and the issues you came across? Thanks
Hermes is just busted
it lags behind the JS language spec - I would not use it
we did use it and than ran into the same problem - took a while to figure it out
never again
Thanks for sharing
That’s very good to know re: Hermes.
good to know that. Thanks!
@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?it's worth considering but I'd like to hear an explanation of why this solves the issue?
The error messages are gone now when I turned the hermes off. Thanks!