My Adventures with React Native and ClojureScript

Clojure

CLJS Welcome ScreenThese are the slides and notes from a short presentation I did at the Portland Clojure Meetup on React Native with ClojureScript and Reagent.

About Me

  • Clojure & ClojureScript consultant (hire me)
  • Was an iOS consultant for many years
  • But …
    • Not a designer
    • Not react-native expert
    • Exploring not shipping

I was an iOS developer and consultant for many years but am now focusing on Clojure and ClojureScript.

And somethings to keep in mind is that I’m only exploring CLJSRN and am not currently shipping anything. Also I’m definately not a designer.


React

Javascript library for building user interfaces

https://facebook.github.io/react/

Many of us have used React and Reagent to create web apps. There is a lot of great documentation and a growing community around React and it seems to be a great way to build web apps.


React Native

Use React to create native components on iOS and Android (and more?)

https://facebook.github.io/react-native/

It can also be used to create native mobile (iOS and Android) applications. That is these are not embeded webviews but actual native UIViews.


Reagent

A simple ClojureScript interface to React.

http://reagent-project.github.io

Reagent is great way to write ClojureScript web apps that use Reagent.


Re-Natal

Template (?) to bootstrap ClojureScript-based React Native apps with Reagent, re-frame and figwheel

Also supports Om.Next and Rum

https://github.com/drapanjanas/re-natal also http://cljsrn.org

Re-Natal brings that to React Native.


Hello World

CLJS Welcome Screen


My experiences … with Caveats

I only know iOS.

For iOS you need Xcode and a Mac.

You also need node.

I believe once you get the app shell on a device you can continue developing with any machine and figwheel and node.

I love the instant feedback and being able to change the design on the fly. The same thing in native development takes for ever.


Installation

Install react native and dependencies

Install re-natal

There’s a lot to install but if you follow the instructions its not too bad. Of course it helps if you are already doing Clojure/ClojureScript and/or iOS development.


My App – Calagator

To try it out. I wrote a small navigation view based app using the public RSS api of an events site here in Portland called Calagator.

Calagator MasterCalagator Details

Not very attractive I know but table and navigator based apps are the bread and butter apps of iOS and I thought it would make a good test case.


Code


Closing Thoughts

Tools a little rough. Red screen of death.

ClojureScript made iOS development fun again.

Need a designer and to understand flex box better.

Lots of third party libraries for camera control, etc.

Realworld performance TBD.

Overall, I loved the immediate feedback. And though I was frustrated with the speed of the final app that could be due to my not using the framework correctly.