Bootstrap ClojureScript React Native apps
Go to file
Dan Motzenbecker 3c89a0a96e added component wrapping to readme goals 2015-08-30 00:17:12 -04:00
resources updated AppDelegate.m template 2015-08-29 16:41:58 -04:00
LICENSE license 2015-08-25 23:38:07 -04:00
README.md added component wrapping to readme goals 2015-08-30 00:17:12 -04:00
index.js init 2015-08-21 23:45:42 -04:00
main.coffee fixed uuid2 creation 2015-08-29 01:46:58 -04:00
package.json package.json 2015-08-25 23:40:24 -04:00

README.md

Natal

Bootstrap ClojureScript-based React Native apps

Dan Motzenbecker, MIT License @dcmotz


Natal is a simple command-line utility that automates most of the process of setting up a React Native app running on ClojureScript.

It stands firmly on the shoulders of giants, specifically those of Mike Fikes who created Ambly and the documentation on setting up a ClojureScript React Native app.

Usage

First, install the CLI using npm:

$ npm install -g natal

Then run natal with your app's name as the first argument:

$ natal FutureApp

If your app is more than a single word, be sure to type it in CamelCase. A corresponding hyphenated Clojure namespace will be created.

When Xcode appears, click the play button to run the app on the simulator.

Then run the following for an interactive workflow:

$ cd future-app
$ ./start.sh

First, choose the correct device (Probably [1]). At the REPL prompt type this:

(in-ns 'future-app.core)

Changes you make via the REPL or by changing your .cljs files should appear live.

Try this command as an example:

(swap! app-state assoc :text "Hello Native World")

Tips

  • Natal requires npm, Leiningen, and CocoaPods to be installed
  • Having rlwrap installed is optional but recommended since it makes the REPL a much nicer experience with arrow keys
  • Don't press ⌘-R in the simulator; code changes should be reflected automatically. See this issue in Ambly for details
  • Running multiple React Native apps at once can cause problems

Aspirations

  • Automatic wrapping of all React Native component functions for ClojureScript
  • Xcode-free development with CLI tools
  • Automatically run React packager in background
  • Automatically tail cljs build log and report compile errors
  • Templates for other ClojureScript React wrappers

Contributions are welcome.