Expo template for Clojurescript React Native
Create React Native apps in Clojurescript with Expo. Impress your friends and build truly native apps across iOS and Android in a sane language!
+ [expo "34.0.3"]
+ [org.omcljs/om "1.0.0-beta1"]
+ [reagent "0.8.1"]
+ [re-frame "0.10.8"]
+ [rum "0.11.1"]
- [boot *broken*]
Pull requests welcome! I don't know enough about Boot
(or have enough time to learn) to support them!
lein new expo your-project +reagent
lein new expo your-project +om
lein new expo your-project +rum
cd your-project
yarn install
To auto-compile Clojurescript code and provide a development REPL
lein figwheel
$ expo start
From here you can Publish, Share, or run the app on a device. See Expo's documentation for more info.
Create file named .lan-ip with your ip. This ip will be used by figwheel to connect via websockets. If this file is not present it gets the ip from the system.
In linux you can execute the following line to create the file.
source lan-ip.sh
If this doesn't work (arch and ubuntu confirmed not to work), manually put your computer's IP address in .lan-ip and open firewall ports 19000, 19001. If you use Cncomplicated Firewall, it's sudo ufw allow 19000/tcp
js/require
it somewhere in your code: (def cljs-logo (js/require "./assets/images/cljs.png"))
(def FontAwesome (js/require "@expo/vector-icons/FontAwesome"))
lein clean
lein prod-build
$ expo publish
Production builds use advanced
closure compilation which sometimes cause problems with javascript interop (details). In the past we ran a custom script to try and prepare a proper externs file, but I've found it to be very problematic and am now recommending the following:
js
interop as dot references can get mangled (.-property js-object)
As this is only an initial template, you'll want to upgrade to newer versions of expo
.
Honestly, it's usually as easy as reading the latest blog post for the new version
and following the upgrade directions at the bottom. It usually comes down to:
app.json
package.json
Sometimes you'll need to upgrade clojurescript rendering dependencies (reagent
and om-next
), and in that case I recommend checking
the issues/commits in this project for solutions.
Copyright © 2017 Sean Tempesta
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.