/ezmonic-mobile

ReactNative mobile app to search for optimal mnemonic phrases to memorize long sequences of numbers using the mnemonic Major System.

Primary LanguageClojure

Development

Shadow-cljs server

`shadow-cljs server`

Build server will be listening at localhost:9630. Nrepl server will be listening at localhost:3333.

The server receives communication from the watcher and compiles the Clojurescript into Javascript, output to `react-native/app`, which is then bundled and supplied to an emulator over websockets by Metro.

Shadow target watcher

`shadow-cljs watch [:app|:free|:pro|:dev-free|:dev-pro]`

Differences between each include:

  • Load devtools
  • Config vars for feature availability checks
  • Initialization function

Watches files for changes and automatically re-compiles the Javascript.

react-native metro bundler

`npx react-native start`

Starts the server that communicates with connected device[s?]. I think it looks for `index.js` in the directory from which it’s run. In our case, we have an `index.js` that simply imports from `app/index.js` which is where Shadow-cljs is outputting our compiled ClojureScript.

Delivery to Android emulator

`npx react-native run-android –flavor [pro|free] –variant [debug|release]`

Must use modified version of CLI that gives ability to pass a “flavor” flag. Or, run the gradle commands manually. See `@react-native-community/cli-platform-android`.

Android builds have a concept of “flavor” that I’m taking advantage of to have free/pro versions. The React CLI doesn’t (didn’t?) have a way to pass those in. So look to https://github.com/eihli/cli for the fork.

https://github.com/eihli/cli/commit/4b0504d2b614695b258e540021e5898121072f37

Custom ReactNative CLI

To modify/install

  • Clone from eihli/cli
  • `yarn`
  • `yarn watch`
  • `yarn link-packages` in /cli
  • `yarn link @react-native-community/cli-platform-android` in /ezmonic-mobile/react-native

When done hacking/editing:

  • `yarn unlink @react-native-community/cli-platform-android`
  • `yarn install –force @react-native-community/cli-platform-android`