Disclaimer: I know absolutely nothing about react-native or expo but I know a lot about optimizing/packaging JavaScript.

I was exploring options to make react-native development with shadow-cljs easier. I did not like the hoops I had to jump through to make the metro packager work reliably. It sort of works out of the box but it pretty slow and frequently gets in the way of the stuff we want to do in CLJS (eg. REPL or hot-reload).

I have this Expo app on my phone which lets me scan a QRCode which then opens the app by talking a linked HTTP server. It seemed pretty straightforward to just copy what this HTTP server did by default and write my own. So about 100 lines of code later I had a working prototype that could load my app directly from the Expo app without any of the react-native or expo tools running. It is not perfect and comes with all sorts of limitations but it might be something worth exploring.

Long story short it is now possible to use shadow-cljs to build an Expo app entirely without either expo or create-react-native-app running. You still need the npm packages installed though.

(ns demo.expo (:require ["react" :as react :rename {createElement $}] ["react-native" :as rn :refer (Text View)] [shadow.expo :as expo] )) (defn render-root [] ($ View nil ($ Text nil "Hello World from CLJS! 1") ($ Text nil "Hello World from CLJS! 2") ($ Text nil "Hello World from CLJS! 3"))) (defn ^:dev/after-load start [] (expo/render-root render-root)) (defn init [] (start))

GitHub shadow-cljs/expo-test Contribute to expo-test development by creating an account on GitHub.

Compared to other react-native things I have seen for CLJS this has virtually zero boilerplate besides the stuff generated by create-react-native-app . I did not use any react wrappers (eg. reagent ) because I wanted the example to be as pure as possible. They all should just work though as long as they can generate a ReactElement .

At this point this is merely a proof-of-concept but with some more work it might be possible to turn this into something usable. It was kind of refreshing to get rid of the metro server completely since it was pretty frustrating to work with.

I have a bunch of questions if someone with in-depth Expo or react-native knowledge wants to help out.