ClojureScript on React Native for Android
Objective-C JavaScript Java Clojure Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
android
ios
src/hello
.flowconfig
.gitignore
.watchmanconfig
README.md
UNLICENSE
build.clj
build.sh
cljs.jar
index.ios.js
index.original.android.js
package.json
watch.clj
watch.sh

README.md

ClojureScript on React Native for Android

Proof of concept for compiling ClojureScript for use on React Native for Android. This is simple ClojureScript JS interop duplicating the React Native example here. The original JavaScript source is in index.original.android.js and the ported ClojureScript code is in src/hello/core.cljs.

To build/run

  1. Set up project for usage: npm install && react-native android
  2. Plug in Android device (or load up emulator).
  3. Set up a reverse socket connection so your app grabs the JavaScripts from the correct place.

    adb reverse tcp:8081 tcp:8081

  4. Build app and push it to the device. Enable auto-refresh in the app options.

    react-native run-android

  5. Start server for serving up JS files to the device app.

    react-native start

  6. Start incremental ClojureScript compilation to recompile when source files change.

    ./watch.sh

  7. Access logs like so:

    adb logcat *:S ReactNative:V ReactNativeJS:V

  8. Hack away in ClojureScript. Saved changes will be automatically compiled to index.android.js and pushed out to the app.