Fork me on GitHub
#shadow-cljs
<
2021-12-17
>
thheller06:12:43

you can't run react-native in node, so node targets won't work. I believe what jest does is replace any react-native require with something else but not sure

thheller06:12:57

I'd assume jest somehow hooks itself into require to do this. dunno how though. maybe its just a build tool, as in it preprocesses the code before running it

thheller06:12:13

eg you could try running :node-test with :js-options {:js-provider :shadow :keep-native-requires true :resolve {"react-native" {:target :npm :require "some-replacement"}}} etc

thheller06:12:57

not really recommended to do this but might be enough if you don't have too many other react-native dependencies

mauricio.szabo13:12:30

Yeah, that's what I tried and it didn't work. As soon as I add another react-native dependency, it fails with some cryptic errors like: Module not provided: @babel/runtime/helpers/interopRequireDefault

Drew Verlee23:12:26

Is there a way to just do a recursive merge on the config? I want to add re-frame-10x by having a local config file and merging it via:

--config-merge re-frame-10x.edn

re-frame-10x.edn
{:builds
 {:dev
  {:devtools
   {:preloads [day8.re-frame-10x.preload]}
   :dev
   {:compiler-options
    {:closure-defines
     {re-frame.trace.trace-enabled?        true
      day8.re-frame.tracing.trace-enabled? true}}}
   :release
   {:build-options
    {:ns-aliases
     {day8.re-frame.tracing day8.re-frame.tracing-stubs}}}}}}
But that doesn't work, i believe it inserts into the build level, but when i do that, my app doesn't start. so i assume it overwrites.