Fork me on GitHub
#cljsrn
<
2020-06-23
>
madeinquant07:06:38

Re-Natal hasn’t been released for a year. is it still worth to implement cljs/react-native with this package?

dotemacs07:06:00

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

Oliver George08:06:43

I’d vote against re-natal for a new project.

Oliver George08:06:09

I like krell but it is pretty new.

pez09:06:24

I would go with Krell if Expo is not an option.

madeinquant09:06:14

I found an error with this statement “clj -m ClojureRNProject.main -co build.edn -c -r”

madeinquant09:06:04

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

madeinquant10:06:16

@olivergeorge thanks for your help. error fixed.

Oliver George11:06:49

In suspect you’ll find the krill issue you reported is not repeatable. Perhaps try a quick repeat of following the tutorial from scratch.

Oliver George11:06:07

Suspect you missed a step or something similar.

madeinquant12:06:30

@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.

benny18:06:55

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

dotemacs18:06:50

re-natal based project?

dotemacs18:06:27

And is the file vanilla, as in stock, what the template would generate?

benny18:06:02

not sure, i deleted it because i was trying to figure out why my image wasn’t getting picked up

benny18:06:22

so i deleted the file thinking it was what was being built but i did and now nothing that needs it can find it

dotemacs18:06:12

Create a new project, copy the file over from it

benny18:06:47

i looked in a newly generated file and it looks compiled, it’s not project specific?

dotemacs18:06:38

You are right

benny18:06:44

for example, i see modules['./images/cljs.png']=require('./images/cljs.png') in a newly generated project

dotemacs18:06:15

Just build your project again

benny18:06:28

i’ve tried a few ways to rebuild it

dotemacs18:06:56

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.

benny18:06:18

I did that but the files contents seem awkward to maintain if that's what happens

benny18:06:10

like the above clause for image references

dotemacs18:06:59

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...

benny18:06:47

when I run just a lein cljsbuild once android the file doesn't appear

benny18:06:23

nor when I use figwheel

dotemacs18:06:54

Did this project ever compile/run?

benny18:06:42

it did yes, I started with the template, made a few modifications, tried to add my own image, deleted the index file, now this

benny18:06:03

prior to adding an image, it was working just fine with my other modifications

dotemacs18:06:24

So the only new thing is the image?

dotemacs18:06:10

What happens if you comment out all the new things you added?

dotemacs18:06:26

Can you run the project then?

benny18:06:42

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"))

dotemacs18:06:41

Does that look like anything that you might have added/required?

spf18:06:58

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

benny19:06:54

that was it!

benny19:06:14

thanks for working with me on it @dotemacs!

👍 3
dotemacs19:06:30

Once you get comfy, look into two more modern options for cljsrn: • shadow-cljs • krell

benny19:06:24

i’m assuming you favor emacs based on your name, is there pretty decent support for one or the other in cider?

benny20:06:30

looks like krell is pretty slick especially for rn…is there an example project out there to look at?

dotemacs20:06:20

Yea, there is. shadow support is in and krell support is in this PR: https://github.com/clojure-emacs/cider/pull/2861

👍 6
benny20:06:33

thanks, is there a simpler way to add dependencies other than a raw deps.edn?

dotemacs20:06:49

Sorry, this is actually a pretty hand holdy tutorial https://github.com/flexsurfer/ClojureRNProject

benny20:06:57

that’s awesome, exactly what i was needing, thanks @dotemacs!

👍 3
dotemacs20:06:46

We really should get a FAQ going with all of this

👍 6
joshmiller23:06:41

There’s a CLJSRN Wiki, might be a good place to start collecting stuff: https://github.com/cljsrn/cljsrn-org/wiki

joshmiller23:06:24

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

joshmiller23:06:40

I can’t find any docs on RN templates, but it seems easy enough to just copy what they’ve done.

joshmiller23:06:54

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.