Awesome
Figwheel React Native Hot Reloading (with Reagent)
Instructions
- Clone the repo:
https://github.com/decker405/figwheel-react-native.git
cd figwheel-react-native
- Install node dependencies:
npm i
- Run figwheel:
lein figwheel
orrlwrap lein figwheel
(if rlwrap installed) - Run packager:
npm start
or./node_modules/react-native/packager/packager.sh
- Open
ios/figTest.xcodeproj
in Xcode - Run app in simulator
- You should see the figwheel dependencies load in the Xcode Console
- Make changes to your code or in the repl and watch figwheel do it's magic
(Optionally (and it's a bit nicer to use) you can press ⌘ + D
in the simulator and select Debug in Chrome
to have your debug ouput in the chrome browser. Be warned that this can lead to errors with your code as Chrome's V8 and iOS' JavascriptCore have some functions that behave differently)
I also advise you to install watchman brew install watchman
(it will make the packager faster)
watchman
Dependency Information
- Should work with React Native >=0.13 (probably works on 0.12 as well)
- Only tested on iOS, not yet on Android
Caveats
- There are issues with requiring nodejs modules because of how React Native's packager works (may be solvable by direct linking instead of using the module name)
- Have not yet devised a great/simple production build step
Production Build Instructions
- Run
lein cljs-build once min
- Run
npm run build
- Link to the local js bundle in AppDelegate.m and run in the simulator
- Errors are most likely related to how React Native is setting its __DEV__ variable (try setting developMode? to false in src/rn_test/core.cljs - need to use the runProduction function rather than runDevelop)