Why Exponent on React Native, especially for Clojurescript – Medium

Well, Exponent lets you write native apps in purely JS (or languages compiled to JS) that work across both IOS and Android.

Detach from Exponent(Alert: under development).

You start with Exponent, later if you need custom native modules, you can run the detach command to create XCode & Android Studio projects and put an ExponentView at the root.

Once lymchat was successfully published on Exponent, I got a link: https: [email protected] /lymchat .

Never heard about Exponent? “Why Exponent on React Native, especially for Clojurescript” is published by Tienson Qin @notbrent: “Why Exponent on React Native, especially for Clojurescript” by @tiensonqin

Well, Exponent lets you write native apps in purely JS (or languages compiled to JS) that work across both IOS and Android. It’s open source, free and uses React Native(RN).

Ok, why bother? Why not just use React Native the standard way?

The Exponent team will handle upgrading. Several members there are core contributors to React Native, they also open sourced tons of useful libraries. https://github.com/exponentjs. Btw, they’re pretty responsive and helpful, just ask them questions on slack: https://slack.exponentjs.com.

You never need to deal with Xcode or Android Studio. All you need is XDE (it’s really lightweight, not IDE — you use your own editor of choice) and the Exponent app on your phone. XDE is a developer tool for creating projects, viewing logs, opening on your device.

In addition to these benefits, the most valuable thing for me is:

Once lymchat was successfully published on Exponent, I got a link: https:[email protected] /lymchat. Now I can send it to my friends or favorite communities. If I made a change, they’ll immediately know that. This is way better than Testflight.

Wait a moment, so far it sounds good but I do need to write native modules, how?

Basically, there are two ways:

So, Exponent is not ready for everyone’s usage now, but hopefully it’ll be soon.

Yeah, definitely!

There are already apps on apple store or google play written by om or re-frame. https://github.com/tiensonqin/lymchat is using re-frame and RN currently.

You can also see my post on experience with Clojurescript and React Native: https:[email protected] [email protected] 47hf8g1qi

To make the experience more better, I’ve created exponent-cljs-template, it supports both Om next and re-frame.

You can also use google closure advanced mode, which not only can significantly reduce the size of the final js bundle(in my case, 3.7M -> 862K), but also provides great obfuscation. You can check: https://github.com/tiensonqin/lymchat-exp/blob/sdk10/js/externs.js