updated readme for 0.1.0
This commit is contained in:
parent
58fcabc383
commit
abf5cd5916
46
README.md
46
README.md
|
@ -11,7 +11,7 @@ setting up a React Native app running on ClojureScript.
|
|||
It stands firmly on the shoulders of giants, specifically those of
|
||||
[Mike Fikes](http://blog.fikesfarm.com) who created
|
||||
[Ambly](https://github.com/omcljs/ambly) and the
|
||||
[documentation](https://github.com/omcljs/ambly/wiki/ClojureScript-React-Native-Quick-Start)
|
||||
[documentation](http://cljsrn.org/ambly.html)
|
||||
on setting up a ClojureScript React Native app.
|
||||
|
||||
|
||||
|
@ -26,31 +26,34 @@ Then, install the CLI using npm:
|
|||
$ npm install -g natal
|
||||
```
|
||||
|
||||
Then run `natal` with your app's name as the first argument:
|
||||
To bootstrap a new app, run `natal init` with your app's name as an argument:
|
||||
|
||||
```
|
||||
$ natal FutureApp
|
||||
$ natal init 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 (or ⌘-R) to run the app on the simulator.
|
||||
If all goes well your app should compile and boot in the simulator.
|
||||
|
||||
Then run the following for an interactive workflow:
|
||||
From there you can begin an interactive workflow by starting the REPL.
|
||||
|
||||
```
|
||||
$ cd future-app
|
||||
$ ./start.sh
|
||||
$ natal repl
|
||||
```
|
||||
|
||||
First, choose the correct device (probably `[1]`). At the REPL prompt type this:
|
||||
Choose your app from the list the REPL outputs (probably `1`) so Ambly can connect.
|
||||
|
||||
At the prompt, try loading your app's namespace:
|
||||
|
||||
```clojure
|
||||
(in-ns 'future-app.core)
|
||||
```
|
||||
|
||||
Changes you make via the REPL or by changing your .cljs files should appear live.
|
||||
Changes you make via the REPL or by changing your `.cljs` files should appear live
|
||||
in the simulator.
|
||||
|
||||
Try this command as an example:
|
||||
|
||||
|
@ -58,8 +61,8 @@ Try this command as an example:
|
|||
(swap! app-state assoc :text "Hello Native World")
|
||||
```
|
||||
|
||||
When the REPL starts it will print the location of its compilation log.
|
||||
It's useful to tail it to see any errors, like so:
|
||||
When the REPL connects to the simulator it will print the location of its
|
||||
compilation log. It's useful to tail it to see any errors, like so:
|
||||
|
||||
```
|
||||
$ tail -f /Volumes/Ambly-81C53995/watch.log
|
||||
|
@ -67,11 +70,24 @@ $ tail -f /Volumes/Ambly-81C53995/watch.log
|
|||
|
||||
|
||||
## Tips
|
||||
- Having `rlwrap` installed is optional but recommended since it makes the REPL
|
||||
a much nicer experience with arrow keys
|
||||
- Having `rlwrap` installed is optional but highly 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](https://github.com/omcljs/ambly/issues/97) in Ambly for details
|
||||
- Running multiple React Native apps at once can cause problems
|
||||
See [this issue](https://github.com/omcljs/ambly/issues/97) in Ambly for details.
|
||||
|
||||
- Running multiple React Native apps at once can cause problems with the React
|
||||
Packager so try to avoid doing so.
|
||||
|
||||
- You can launch your app on the simulator without opening Xcode by running
|
||||
`natal launch` in your app's root directory.
|
||||
|
||||
- By default new Natal projects will launch on the iPhone 6 simulator. To change
|
||||
which device `natal launch` uses, you can run `natal listdevices` to see a list
|
||||
of available simulators, then select one by running `natal setdevice` with the
|
||||
index of the device on the list.
|
||||
|
||||
- To change advanced settings run `natal xcode` to quickly open the Xcode project.
|
||||
|
||||
|
||||
## Dependencies
|
||||
|
@ -93,7 +109,7 @@ tools.
|
|||
|
||||
## Aspirations
|
||||
- [ ] Automatic wrapping of all React Native component functions for ClojureScript
|
||||
- [x] Xcode-free development with CLI tools
|
||||
- [x] Xcode-free workflow with CLI tools
|
||||
- [ ] Automatically run React packager in background
|
||||
- [ ] Automatically tail cljs build log and report compile errors
|
||||
- [ ] Templates for other ClojureScript React wrappers
|
||||
|
|
Loading…
Reference in New Issue