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
raspasov 2021-05-06T00:25:53.188200Z

@dotemacs What do you think is missing “in those steps in the middle”? Curious what’s been your experience, and if there’s anything we can work on to make better. Do you think that’s a problem for ClojureScript libs/tooling to solve or just in general React Native? There’s not much that exists in React Native (with the one exception of reanimated-v2 that I’ve encountered, but that’s a special case) that can’t be used directly from ClojureScript. Some of the questions I’ve noticed here are “simple” interop questions. You have to be comfortable with ClojureScript + React + JavaScript + mobile dev by itself. You’re guaranteed to struggle in most cases. The question is how much struggle you can tolerate 🙂 . JVM Clojure or browser-based Clojure(Script) + React is most definitely better place to start if you’re new to development in general. Just in my experience, I was able to develop a production e-commerce iOS React Native app in ClojureScript in 2016 in about 6-8 weeks (all the code written by myself). But I was quite comfortable with Clojure(Script) and React itself at that point. I think (while not perfect) things have only gotten better since then (working on a new app at the moment, getting close to a release).

dotemacs 2021-05-06T08:08:38.206300Z

> What do you think is missing “in those steps in the middle”? Just see the history of this chat and see what the people have been asking for consistenly. You’ll get it all there. I’ve pointed out the issues above, here they are again: - a nice integration testing story - a good way to re-use all the UI styling libraries

jaime 2021-05-06T10:59:50.206600Z

+1 for the integration testing. In general I don't see testing cljs react-native being talked about. I'm struggling with this, now I'm thinking to approach it by: • using cljs.test and shadow-cljs browser-test to run unit-tests (just util functions, making sure I'm not including any react-native component which shadow-cljs will fail to compile). Although I have not played with it long enough • use detox for integration/e2e testing, written in javascript (I don't think its worth the trouble writing test in clojurescript as of the moment).

👍 1
jaime 2021-05-06T11:10:06.207Z

I'm not sure if there is a way to execute cljs tests in the repl

dotemacs 2021-05-06T22:37:10.213900Z

That’s fine and I don’t disagree. This is what I saw people ask for in this channel when they pick up cljsrn.

👍 1
raspasov 2021-05-06T00:29:01.189900Z

Just simply grokking XCode by itself is an intense task. I remember in 2016 staring at and trying all knobs for hours and days before I figured out what’s what 😂

raspasov 2021-05-06T00:32:15.190900Z

Can anyone say what any of this does? LOL After all those years, I still just click through to find what I need.

raspasov 2021-05-06T00:35:53.193800Z

Thankfully, you barely need to touch it, except for doing a release build. But you still need to know where to click… And how to configure a Release “scheme” is a whole another thing… A lot of tiny but important details related to mobile dev… Expo tries to “solve” all of that but I haven’t had the time/desire to try their “full experience”. Even though I use their libraries, which are high quality. I use them in a “bare” project. As far as I can tell, if you use a “fully managed expo project” that comes with some hard limitations (just reading/looking from the outside).

2021-05-06T01:22:03.198900Z

Hi everyone - apologies in advance for the noob question: I've built a shadow-cljs / re-frame SPA app (pretty simple, about 5k lines of code; using auth0 for auth, postgresql, heroku for hosting) and I'd like to refactor it for React Native. I'm pretty new to clojure (coming from a Python background) and I love how fun it is. But when it comes to cljs-rn, I'm pretty confused as to where to start (expo or React Native CLI, do I continue using shadow-cljs, etc.). Some guidance would be much appreciated.

dotemacs 2021-05-06T08:05:21.206100Z

Back in October I did this questionnaire on cljsrn, only about 5 people responded, who had apps in production. About 4 or maybe all 5 used shadow-cljs. So if you’re worried that this is somehow not the right tool, I’d like to dispel that myth. And to point out that the other tools are just fine if they work for you/suit your style.

2021-05-06T12:00:56.207300Z

Fantastic, thank you everyone. @raspasov - it is indeed a web app, and I was hoping I can easily port my components & views to RN. I think I'm going to take the shell recommended by @pez and copy-paste the business logic functions, then start with the components & views from scratch.

👍 1
raspasov 2021-05-06T02:43:06.199Z

No need for apologies at all! Read my comment above. I assume this was a browser-based/HTML/React app that you’ve built? If yes, you should assume that most of your React views/components will have to be written brand new for React Native. If you have some business/state logic that is well separated, you should be able to re-use most of that.

raspasov 2021-05-06T02:45:44.199300Z

But I would create a brand new project, start from scratch and copy/paste parts into it to begin with. At that point you should be able to develop a feel which parts of your code can be transferred directly and which ones need modification for React Native. Directly “refactoring” a browser-based app into React Native does not feel feasible to me. Too many moving parts that are different.

raspasov 2021-05-06T02:48:34.200Z

And yes, you should be able to continue using shadow-cljs (I haven’t used it but many people seem to be using it more than fine for React Native)

pez 2021-05-06T05:22:00.202100Z

Expo is quite awesome. If you can use it, I say use it. See this video for a discussion about the trade offs. https://youtu.be/7-t6deIO1JE

pez 2021-05-06T05:32:29.205700Z

This example project uses shadow-cljs and expo. https://github.com/PEZ/rn-rf-shadow It is wired so that it targets both phones and the web. Maybe just check how hard/easy it is to port something from your React app into that ”shell”?

👌 1
dnolen 2021-05-06T12:57:38.208600Z

RN is great but I think it's like the JVM or JavaScript - it's possible to get along w/o knowing that much for some kind of applications - but the more you know about Android & iOS and the tooling the easier it's going to be in the long run

dnolen 2021-05-06T12:58:28.209300Z

to me, the value prop, like Clojure, is pushing that stuff to the edges - not trying to push it under a rug

💯 1
☝️ 2