
Publishing an iOS App with ClojureScript and React Native - spinningarrow
http://increasinglyfunctional.com/2018/08/17/i-published-an-ios-app-with-clojurescript-and-react-native.html
======
Improvotter
> Pros > Functional Reactive Programming

Is this still a pro? Reactive programming is very popular in Native Android
development and I assume as well on iOS with RxSwift and similar libraries.

I worked on a React Native app for a while and am sure to never return to it.
Constant breaking changes, bad/lacking native implementations, and hacky ways
of implementing natively supported features like Dialogs/Bottomsheets on
Android make it a no-go.

~~~
gilgoomesh
RxJava and RxSwift are Reactive Programming, not _Functional_ Reactive
Programming. FRP includes behaviors and hence truly continuous values and
intercepts. RP has to use subjects, side effects, hot and cold observables and
other nonsense. They’re quite different even though most online commenters
tend to be unaware that there is a difference.

~~~
trevor-e
RxJava's Github says "RxJava is a Java VM implementation of Reactive
Extensions". The Reactive Extensions website claims it is "Functional: Avoid
intricate stateful programs, using clean input/output functions over
observable streams." You're saying that it's not?

------
bribri
I really enjoy Clojurescript + React Native as well. Re-Frame + Hiccup is way
better than redux + JSX. I'm pretty sure I can write equivalent apps with 50%
less code compared to the Redux/UI boilerplate in most React apps.

~~~
Clever321
To add one data point; I rewrote one of our applications that was
Redux+React+Typescript with exact feature parity in
Re_Frame+Reagent+Clojurescript. It was 4.7x less code. We continued
development on the cljs app and abandoned the typescript app. Months later the
app is ~17,000 LOC. I shutter to think how the equivalent typescript would
have turned out.

~~~
nwienert
Redux is verbose but there are far less verbose options for React+Typescript.

I find clojure/script to be too dense for my taste in most examples. I
actually really prefer a few more LoC, so that's a poor metric for
effectiveness. Your IDE can deliver far more savings in time while encouraging
_more_ LoC often.

~~~
rlander
Your taste has nothing to do with effectiveness. There's plenty of evidence
that loc are one of the most reliable predictors of # of bugs in a codebase.

~~~
nwienert
I can make a one line program, I wonder how many bugs that would eliminate?

------
serpix
Currently using a similar stack with Expo and it has been great.

There is no substitute for a real REPL and immediate code changes.

~~~
rboyd
have you been able to keep up with expo sdk releases?

I have a cljsrn app still on expo 23 and it's turned into kind of a trainwreck
to update. considering dropping expo for vanilla re-natal

~~~
serpix
Well luckily I started with a version that was not that hard to update as of
yet.

I expect it to get harder though but this being a side project I'm not that
worried.

------
krn
Related: has anyone published an Android app with ClojureScript and React
Native? How much did the fact, that React Native for Android is incompatible
with 3rd-party 64-bit libraries[1] affect the development?

[1] [https://github.com/facebook/react-
native/issues/2814](https://github.com/facebook/react-native/issues/2814)

------
Scooty
I hope React Native matures into a powerful and ubiquitous tool. I love React,
but my experiences with React Native have been incredibly frustrating. If a
client wants a multi-platform app, I can get a smoother more consistent
experience from Cordova/React than React Native.

------
_zachs
Is there an easy way to do this iOS development on an Linux platform? I have a
Macbook Retina from 2012 that's a pain to use because the battery will die
unless plugged in, and they don't offer replacement batteries for my model.

My next option is to put MacOS on a VM in Arch Linux, but ideally I'd like an
easier solution before I go down that route...

~~~
evv
Have you tried Expo? It allows you to develop directly on your iPhone, with
the development server happily running on Windows or Linux.

The easiest way to try it is at
[https://snack.expo.io/](https://snack.expo.io/) , which is an in-browser dev
environment for React Native. All you need is the Expo app on your iPhone or
Android.

Disclaimer: Expo supports my work on React Navigation, the JS navigation
framework for React Native. But I would recommend them regardless!

------
tspike
React Native is fine for small, standalone apps. Don't ever try to integrate
it into an existing native app. Better to stick to 100% native or rewrite it
completely.

~~~
AJRF
I integrated it in a top-100 app in the app store in less than a day and it
works perfectly for us.

If you don't know the iOS or Android build chains I would imagine that its
confusing and troublesome, but unless you are doing some fairly extensive
native compatibility stuff you will reap great efficiency benefits from adding
it to an existing app.

~~~
tspike
> integrated it in a top-100 app

Same. Been leading the native side of an app with 30-40 native devs and ~20 JS
devs. Initial integration is easy, but it opens up a lot of problems as time
goes on.

------
holtalanm
Last time I tried ClojureScript, I found the interop with web APIs and vanilla
js libraries to be horribly lacking, and development was abysmally slow as a
result.

I loved Clojure when I used it, but ClojureScript was a nightmare.

The only saving grace was shadow-cljs, which made it bearable to work with. I
eventually dropped it in favor of Elm mostly for the static typing, but also
for the tooling, which is leaps and bounds better.

~~~
cutler
If your main problem was interop with vanilla JS libs how can Elm possibly be
an improvement over Clojurescript?

~~~
holtalanm
because ports actually work as documented, even if their functionality is
limited.

