Fork me on GitHub

heya has anyone been using shadow/expo/react native recently?


I’ve been away from the area for a couple years


and just going back to it for a hobby project


everything has moved on a bit and the new client doesn’t have the same ‘hot reload/fast reload’ it now has ‘fast refresh’


I want to disable all that so can rely on shadows reloading, but I don’t seem to be able to switch off the reloading…I keep getting an error every time it reloads saying DevMenu not found


I’m curious if anyone has any updates or tips since 2019


@danieleneal fwiw since 2019 there's also krell, a tool that David Nolen built


there's also a #cljsrn channel about React native


ah yeah I did see the announcement but don’t know anything about krell. I guess that is separate from expo. I really like the expo client and convenience for sharing and building the project but maybe Krell is better


@danieleneal Hi, I have been working with that stack, I'm pretty new on it, but I'm doing a hobby project with it. I found a repo that could help you: If you look at the commit history you'll find a commit that disables webpack's fast refresh. They say that it let's shadow's hot reload do all the work. I tried to do that and had no luck, it disabled both refreshes


ah yeah interesting. Thanks @u.sk8


I think that commit is about disabling it for the web app rather than the rn app


but it does say maybe enabling and then disabling fast refresh might work


I’ll try that


I dont have problems to disable fast refresh in my rn app. I just shake my phone (or emulator) and disable from the dev menu. Maybe you need to update the libraries or put compatible versions. If you clone that repo it should work. The only problem I have with it is Expo warning me about a file that ends with .expo.js that Shadow (I think) produces and it will be no longer compatible with future expo versions.


yeah I get that error, but also every time a reload happens I get some error about DevMenu.


I’m on the latest version of expo and shadow, so possibly something changed


I remember the ecosystem can be quite fragile


As I said, I'm pretty newbie, so I would do the following: • Look at the versions of your npm libs and ensure are the same as the project from PEZ • Delete node_modules and any other output folder • npm i • Start shadow and then start expo I have noticed that not necessarily ultimate versions are the best, in fact, I found that using the lastest expo version didn't compile my project, so I used the PEZ' version. Also, deleting every output folder have solved me problems when I was updating my libs. Hope you can solve your problem :)


The .expo.js error can be solved with an env var like this though really I think that file should be renamed in shadow There is also a bug with expo where starting the expo go app with fast refresh disabled won't actually fully disable it, so you have to enable and disable it again for it to actually disable

😃 1

Hey, how do i consume environment variables? I have defined one like this:

 {:app {:asset-path "/js"
        :modules {:main {:init-fn app.core/main}}
        :output-dir "public/js"
        :target :browser
        :closure-defines { #shadow/env "HEY Simon"}
        :js-options {:ignore-asset-requires true}}
But then how do i get it so that i can do this:
(prn Greeting)


Following this i need to use (goog-define variable-name "default value") But it only provides the default value and doesn't get overwritten


It works with shadow-cljs release app -config-merge '{:closure-defines {app.envvars.core/APP_ENV :dev}}'

thheller17:08:23 would be (goog-define Greeting ...) in (ns somewhere. should be fine.


Yes thank you. Would be great with this example in the Shadow-cljs User Guide


Hey can you recommend any good template or blueprint for configuring pedestal together with shadow-cljs, I mean something which will handle full stack (clj, cljs, cljc)?


pedestal doesn't care about shadow-cljs and shadow-cljs doesn't care about pedestal


pretty much the only config you need to have in pedestal is that it serves the static .js files generated by shadow-cljs


can't remember what that setting was. something ::http/file-root or so ::http/resource-root or so


Which closure complier should I be using with shadow-cljs 2.15.6?

thheller17:08:47 v20210505