I don't know if this has been asked before but I am trying to require a json file in a react native project. Is it possible to do with shadow? If yes can someone please outline the process? thanks!
Right now I have a "src/js/my/namespace/foo.json" file and I am including the "src/js" in my :source-paths
I do not succeed when it comes to actually requiring the file
One other thing I tried is to include a :js-options
with :resolve
to my json file to no avail
@g7s you can only require json files via js/require
to let metro fill it in
(def data (js/require "../assets/foo.json"))
path is relative to the created :output-dir
ah I actually never tried that.. Thanks @thheller
What's the status of code splitting with Reagent applications? I've found this 2 year old blog post by Thomas (https://code.thheller.com/blog/shadow-cljs/2019/03/03/code-splitting-clojurescript.html). It splits code but reactifies Reagent component before rendering. It it possible to lazy load Reagent components?
thats what the post describes?
In your post, the Reagent components are Reactified: https://github.com/thheller/code-splitting-clojurescript/blob/master/src/main/demo/util.cljs#L27 This means that Ratoms and Reframe cannot be used, since ratoms don't work with reactified components.
thats not correct
the wrapper loading the component is reactified. not the actual component
the actual component can do whatever
Oh, okay. I had a gap in my understanding.
Will try it out.
Hi, i ve been using shadow-cljs with lein to this day. Today i removed :lein true
and moved all clojurescript deps into shadow-cljs.edn. When I run shadow-cljs watch app
it fails with the required namespace devtools.preload is not available.
But binaryage/devtools 1.0.2.
Is one of my dependencies in shadow-cljs. edn.
What is the problem? Should i go back to combination of lein and shadow-cljs even if it is discouraged fy shadow-cljs website?
@jakub.zika-extern should be working fine. you sure you declared it correctly? no misplaced []
or so?
No, but i am glad to hear that cljs dependencies should work 1:1 with lein. I moved everything back to lain but i will investigate further later for sure. Is there some debugging on shadow-cljs side like "show me installed dependencies" etc?
shadow-cljs info
shows a bit
I didn't found a way to run with node-tests to activate :auto-run true only on watch, there's a way to to this on shadow-cljs cli like
shadow-cljs watch :my-test something-here
?
shadow-cljs watch my-test --config-merge "{:autorun true}"
thanks @thheller 🙂
=))