My experience with Clojurescript and React Native
IOS app link:
I went to look at Clojurescript, It works like this:
I thought ok, looks good.
Several months ago I quit my job to travel, you know, I call it “immutable gap year”. When i came back, I thought why not write an app to find local people, explore different cultures?
When I decided to do it, I actually thought about swift/obj-c for one second, I went away just because drag ‘n drop is too magical for me.
After browsing the react native documentation and the versatile UIExplorer, I decide to go with it.
So, awesome choice! Actually even now, I’m still trembling with fright when I have bad dreams about this:
Maybe i’m digging too deep a hole in the beach, but if you ask me what’s my experience about React Native with Clojurescript, it looks like this:
It’s riding in the mud, a little tough, but enjoyable!
The enjoyable part
Learn once, write everywhere.
All the api service, ios app, web page and admin panel are written by Clojure[script]. So I can save huge time by sharing most of the logic and components.
I won’t do any clojurescript web or mobile development without it. Hot reloading, much better error report. Thank you, Bruce Hauman!
Re-Natal is a simple command-line utility that automates most of the process of setting up a React Native app running on ClojureScript with Reagent an re-frame.
Flexbox, interactive repl, source maps…
Rich libraries, diligent community.
Performance is actually good.
I’ve worried about the Listview performance issue, turns out not a big problem for me now.
Seamless bridging with native.
Bad news is you still need to write a little native code. You don’t want put your access token in the bundle. Good news is it’s really easy.
The tough part
React Native: Unable to resolve module ‘some-module’ #4968
npm cache clean && watchman watch-del-all && rm -rf node_modules && npm install && npm start -- --reset-cache
Clojurescript re-natal: You have to restart repl when importing new react native modules or pictures.
This is really a big distraction.