Fork me on GitHub
#cljsrn
<
2021-05-06
>
raspasov00:05:53

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

dotemacs08:05:38

> 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

jaime10:05:50

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

👍 2
jaime11:05:06

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

raspasov21:05:26

I’ve never been a fan of “UI styling libraries”. All the ones I’ve looked at, they only allow you to do “lowest common denominator design”. Figuring out how to customize them always seems harder than just writing the CSS from scratch.

💯 6
dotemacs22:05:10

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

👍 3
raspasov00:05:01

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 😂

raspasov00:05:15

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

raspasov00:05:53

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

Emi Gal01:05:03

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.

raspasov02:05:06

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.

raspasov02:05:44

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.

raspasov02:05:34

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)

pez05:05:00

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

pez05:05:29

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”?

👌 3
dotemacs08:05:21

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.

Emi Gal12:05:56

Fantastic, thank you everyone. @U050KSS8M - 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 @U0ETXRFEW and copy-paste the business logic functions, then start with the components & views from scratch.

👍 2
dnolen12:05:38

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

dnolen12:05:28

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

☝️ 4
💯 2
raspasov21:05:26
replied to a thread:@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 :slightly_smiling_face: . 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).

I’ve never been a fan of “UI styling libraries”. All the ones I’ve looked at, they only allow you to do “lowest common denominator design”. Figuring out how to customize them always seems harder than just writing the CSS from scratch.

💯 6