This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-30
Channels
- # adventofcode (4)
- # aleph (1)
- # announcements (6)
- # babashka (11)
- # beginners (63)
- # calva (73)
- # clj-kondo (9)
- # clj-on-windows (20)
- # cljdoc (8)
- # cljsrn (4)
- # clojure (48)
- # clojure-europe (20)
- # clojure-italy (1)
- # clojure-nl (11)
- # clojure-spec (11)
- # clojure-uk (3)
- # clojurescript (32)
- # cloverage (1)
- # conjure (1)
- # cryogen (5)
- # datomic (83)
- # fulcro (28)
- # graphql (23)
- # gratitude (4)
- # helix (15)
- # honeysql (4)
- # improve-getting-started (14)
- # introduce-yourself (3)
- # jackdaw (5)
- # kaocha (11)
- # leiningen (1)
- # malli (1)
- # meander (5)
- # off-topic (18)
- # pathom (17)
- # pedestal (6)
- # polylith (15)
- # practicalli (1)
- # quil (2)
- # reitit (4)
- # releases (6)
- # shadow-cljs (38)
- # sql (20)
- # testing (6)
- # timbre (5)
- # tools-deps (11)
- # vim (2)
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
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
thanks!
@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: https://github.com/PEZ/rn-rf-shadow 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 https://github.com/armincerf/kalm-mobile/blob/master/package.json 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
ooh cool thanks @alex395
Hey, how do i consume environment variables? I have defined one like this:
{:builds
{:app {:asset-path "/js"
:modules {:main {:init-fn app.core/main}}
:output-dir "public/js"
:target :browser
:closure-defines {app.helpers.analytics/Greeting #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)
I'm following this: https://shadow-cljs.github.io/docs/UsersGuide.html#shadow-env
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}}'
app.helpers.analytics/Greeting
would be (goog-define Greeting ...)
in (ns app.helpers.analytics)
somewhere. should be fine.
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)?
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
https://clojars.org/thheller/shadow-cljs lists it on the right side