Fork me on GitHub
#shadow-cljs
<
2019-05-12
>
Stefan10:05:58

I’m almost done getting all the basics in place for my new cljs / react native project. I got all the web audio / embedded webview stuff working, including injecting my clojurescript-compiled-javascript into the webview. (REPL inside that webview is working on iOS but not on Android; there it says “shadow-cljs - connection closed!“, but I didn’t yet look into that). I’m currently trying to get binaryage/devtools to work. According to the shadow-cljs user manual, if I understand correctly, all it should take is adding the dependency. It isn’t installed then though in my react-native target, and when I try to force it (`(devtools/install!)`) it says it is not installing under advanced builds. But I’m just running watch, so that should not be an advanced build, right? Any ideas?

Stefan10:05:00

Oh wait that’s strange, after forcing recompile and having :autoload triggered, cljs-devtools is installed properly, but only because of the explicit devtools/install that I have in there. :thinking_face:

thheller11:05:27

@stefan.van.den.oord cljs-devtools is only installed automatically for the :browser target. I'm not sure if react-native even supports it at all

Stefan11:05:26

Right, I suspected as much, thanks.

thheller11:05:18

btw you don't need to call install or reference the devtools at all ... just add :devtools {:preloads [devtools.preload]}

Stefan11:05:53

Yeah I know but I was just trying to force it 🙂

Stefan11:05:31

And that preloads thing shouldn’t normally be necessary either with shadow (in browser) right?

thheller11:05:33

not sure what forcing means but the preload literally just calls install

Stefan11:05:50

🙂 Just to make sure, ignorance on my part 🙂

thheller11:05:07

cljs-devtools uses a feature that as far as I know only the chrome devtools support

thheller11:05:23

so I'd be rather surprised if it actually worked in a react-native webview

thheller11:05:40

given that there is no graphical console to begin with?

Stefan11:05:10

Well you can still use “remote debugging” which works with chrome, so I’m actually hopeful that it may still work.

Stefan11:05:38

That’s from my react native app (but only after reload, not initally).

thheller11:05:49

right yeah that should work if you add the preload

👍 4
Stefan12:05:08

Not sure why initially it doesn’t want to install and mentions :advanced, but I think I may have to look up in the cljs-devtools sources what kind of check they are doing for that.

darwin12:05:32

it looks like devtools.version namespace is not present in your case, advanced build check assumes it gets munged

Stefan13:05:41

Yes with that pref it indeed works, thanks! 👍

thheller12:05:57

always need to remember that metro actually processes all the sources before they get loaded

thheller12:05:06

so whatever that may be doing might get you in trouble there

thheller12:05:22

it might also be that the react-native target doesn't support preloads at all

thheller12:05:34

can't remember if I added it there 😉

thheller12:05:44

will check later, gotta go

Stefan12:05:06

I think that might be the case. Cheers!