Re-Natal hasn’t been released for a year. is it still worth to implement cljs/react-native with this package?
Considering that it’s pegged at 0.59-ish version and the current react-native is on 0.62 which has different linking (at least on iOS), you could say that it’s a bit long in the tooth
I’d vote against re-natal for a new project.
I like krell but it is pretty new.
I would go with Krell if Expo is not an option.
I am following this tutorial https://github.com/vouch-opensource/krell/wiki/Reagent-Tutorial
I found an error with this statement “clj -m ClojureRNProject.main -co build.edn -c -r”
MacBookPro:ClojureRNProject nelson$ clj -m ClojureRNProject.main -co build.edn -c -r Execution error (FileNotFoundException) at clojure.main/main (main.java:40). Could not locate ClojureRNProject/main__init.class, ClojureRNProject/main.clj or ClojureRNProject/main.cljc on classpath. Full report at: /var/folders/d7/4gp8p7_146bbm8_hfcwm4kgw0000gn/T/clojure-3746238116355655156.edn MacBookPro:ClojureRNProject nelson$ pwd /Users/Shared/Relocated_Items/Security/eUSB/sync/reactNative/ClojureRNProject
-m krell.main
@olivergeorge thanks for your help. error fixed.
In suspect you’ll find the krill issue you reported is not repeatable. Perhaps try a quick repeat of following the tutorial from scratch.
Suspect you missed a step or something similar.
@olivergeorge I missed some steps and fixed, krill setup is relatively easier than others. However, I still learning how to interpolate with other packages e.g React Navigation, stack.
These might be of some help https://github.com/condense?q=Cljsrn+&type=&language=
@olivergeorge Thank you
i accidentally deleted the index.android.js
from the root of my project now everything is broken. how do i regenerate that? i tried lein cljsbuild once
re-natal based project?
aye
And is the file vanilla, as in stock, what the template would generate?
not sure, i deleted it because i was trying to figure out why my image wasn’t getting picked up
so i deleted the file thinking it was what was being built but i did and now nothing that needs it can find it
Create a new project, copy the file over from it
i looked in a newly generated file and it looks compiled, it’s not project specific?
Oh my bad
You are right
for example, i see modules['./images/cljs.png']=require('./images/cljs.png')
in a newly generated project
Just build your project again
i’ve tried a few ways to rebuild it
Hmm I’m not in front of a computer right now, but what I’d do is: I’d generate a new vanilla project and look at that.
I did that but the files contents seem awkward to maintain if that's what happens
like the above clause for image references
Honestly, when I first read your comment, I thought that you’re talking about a cljs file. But if it’s a js file, that is generated by compiling the project...
when I run just a lein cljsbuild once android
the file doesn't appear
nor when I use figwheel
Did this project ever compile/run?
it did yes, I started with the template, made a few modifications, tried to add my own image, deleted the index file, now this
prior to adding an image, it was working just fine with my other modifications
So the only new thing is the image?
What happens if you comment out all the new things you added?
Can you run the project then?
interesting, i tried that and the index file is generated but i still have an error
error: bundling failed: Error: index.android.js:Invalid call at line 19: require(path.join(path.resolve("."), "target/android", "goog", "bootstrap", "nodejs.js"))
Does that look like anything that you might have added/required?
if i am not mistaken, the index file should be regenerated when you reset the re-natal device
re-natal use-xx-device && re-natal use-figwheel
that was it!
thanks @spf!
thanks for working with me on it @dotemacs!
Once you get comfy, look into two more modern options for cljsrn: • shadow-cljs • krell
i’m assuming you favor emacs based on your name, is there pretty decent support for one or the other in cider?
looks like krell is pretty slick especially for rn…is there an example project out there to look at?
Yea, there is. shadow support is in and krell support is in this PR: https://github.com/clojure-emacs/cider/pull/2861
Sample projects • shadow https://github.com/thheller/reagent-react-native • krell https://github.com/vouch-opensource/krell/wiki/Reagent-Tutorial
thanks, is there a simpler way to add dependencies other than a raw deps.edn
?
Sorry, this is actually a pretty hand holdy tutorial https://github.com/flexsurfer/ClojureRNProject
that’s awesome, exactly what i was needing, thanks @dotemacs!
We really should get a FAQ going with all of this
There’s a CLJSRN Wiki, might be a good place to start collecting stuff: https://github.com/cljsrn/cljsrn-org/wiki
I also looked into but didn’t have time to finish putting together a Krell template for RN, like this Typescript one: https://github.com/react-native-community/react-native-template-typescript
I can’t find any docs on RN templates, but it seems easy enough to just copy what they’ve done.
The missing piece is when you do npx react-native init MyApp --template react-native-template-krell
you need to be able to create src/my_app/core.cljs
for example, and it doesn’t seem like there’s a post-install hook to do that.