cljsrn

https://github.com/drapanjanas/re-natal | https://github.com/drapanjanas/re-natal/wiki/FAQ | https://github.com/condense/mercury-app/wiki | https://github.com/seantempesta/expo-cljs-template/ https://www.npmjs.com/package/create-expo-cljs-app
madeinquant 2020-06-23T07:28:38.363600Z

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

dotemacs 2020-06-23T07:30:00.364600Z

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 George 2020-06-23T08:44:43.365600Z

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

Oliver George 2020-06-23T08:45:09.366200Z

I like krell but it is pretty new.

pez 2020-06-23T09:13:24.367400Z

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

madeinquant 2020-06-23T09:35:28.367700Z

I am following this tutorial https://github.com/vouch-opensource/krell/wiki/Reagent-Tutorial

madeinquant 2020-06-23T09:38:14.368500Z

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

madeinquant 2020-06-23T09:39:04.368800Z

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

Oliver George 2020-06-23T09:57:56.369500Z

-m krell.main

madeinquant 2020-06-23T10:31:16.371100Z

@olivergeorge thanks for your help. error fixed.

Oliver George 2020-06-23T11:06:49.373400Z

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 George 2020-06-23T11:07:07.373900Z

Suspect you missed a step or something similar.

madeinquant 2020-06-23T12:26:30.375900Z

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

Oliver George 2020-06-23T13:31:00.377500Z

These might be of some help https://github.com/condense?q=Cljsrn+&type=&language=

madeinquant 2020-06-23T13:40:31.377900Z

@olivergeorge Thank you

benny 2020-06-23T18:30:55.378800Z

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

dotemacs 2020-06-23T18:31:50.379300Z

re-natal based project?

benny 2020-06-23T18:31:57.379500Z

aye

dotemacs 2020-06-23T18:32:27.380300Z

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

benny 2020-06-23T18:33:02.381100Z

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

benny 2020-06-23T18:33:22.381800Z

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

dotemacs 2020-06-23T18:34:12.382700Z

Create a new project, copy the file over from it

benny 2020-06-23T18:34:47.383400Z

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

dotemacs 2020-06-23T18:35:30.383800Z

Oh my bad

dotemacs 2020-06-23T18:35:38.384200Z

You are right

benny 2020-06-23T18:35:44.384600Z

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

dotemacs 2020-06-23T18:36:15.385400Z

Just build your project again

benny 2020-06-23T18:36:28.385800Z

i’ve tried a few ways to rebuild it

dotemacs 2020-06-23T18:38:56.387400Z

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.

benny 2020-06-23T18:46:18.388200Z

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

benny 2020-06-23T18:47:10.389300Z

like the above clause for image references

dotemacs 2020-06-23T18:47:59.390500Z

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

benny 2020-06-23T18:48:47.391300Z

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

benny 2020-06-23T18:49:23.391900Z

nor when I use figwheel

dotemacs 2020-06-23T18:49:54.393300Z

Did this project ever compile/run?

benny 2020-06-23T18:50:42.394500Z

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

benny 2020-06-23T18:51:03.395200Z

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

dotemacs 2020-06-23T18:51:24.395800Z

So the only new thing is the image?

dotemacs 2020-06-23T18:52:10.396700Z

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

dotemacs 2020-06-23T18:52:26.397100Z

Can you run the project then?

benny 2020-06-23T18:56:42.397600Z

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

dotemacs 2020-06-23T18:58:41.399600Z

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

2020-06-23T18:58:58.399800Z

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

benny 2020-06-23T19:01:54.400100Z

that was it!

benny 2020-06-23T19:01:58.400400Z

thanks @spf!

benny 2020-06-23T19:02:14.400800Z

thanks for working with me on it @dotemacs!

👍 1
dotemacs 2020-06-23T19:03:30.402200Z

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

benny 2020-06-23T19:37:24.402900Z

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

benny 2020-06-23T20:14:30.403900Z

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

dotemacs 2020-06-23T20:15:20.404100Z

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

👍 2
dotemacs 2020-06-23T20:17:17.405200Z

Sample projects • shadow https://github.com/thheller/reagent-react-native • krell https://github.com/vouch-opensource/krell/wiki/Reagent-Tutorial

benny 2020-06-23T20:19:33.406200Z

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

dotemacs 2020-06-23T20:21:49.407300Z

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

benny 2020-06-23T20:27:57.408100Z

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

👍 1
dotemacs 2020-06-23T20:31:46.409100Z

We really should get a FAQ going with all of this

👍 2
joshmiller 2020-06-23T23:34:41.409600Z

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

joshmiller 2020-06-23T23:40:24.410100Z

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

joshmiller 2020-06-23T23:40:40.410600Z

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

joshmiller 2020-06-23T23:41:54.411700Z

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.