bhauman / react-native-figwheel-bridge

Enables React Native projects written in ClojureScript to use Figwheel's live reloading and REPL.
80 stars 11 forks source link

What to do when try to release application #4

Open neutrous opened 5 years ago

neutrous commented 5 years ago

Firstly, thank you for this great project. Comparing to the original approach, this one is much handier 👍

Everything works perfectly when developing, however, stuck when trying to generate a release version.

Errors like the followings:

ReactNativeJS: Module AppRegistry is not a registered callable module (calling runApplication)
ReactNativeJS: Unable to symbolicate stack trace: Bundle was not loaded from the packager

Although this project is mainly used to facilitate the usage of figwheel when development, eliminating this library (for example, don't use bridge to startApp) and execute something like clj -A:fig -m figwheel.main -O advanced -bo prod seems still working.

However, when generating a released APK, it would crash as soon as launching the application. The major reason is cljsExports is undefined. The tricky thing comes here, when react-native run-*, this cljsExports could be loaded while what should we do when issuing the release one?

There is another option to drawback to using lein related configuration, however, it would lose the convenience of direct ns name mapping.

Any recommendation?

raspasov commented 4 years ago

What I did to get production builds to work is simply prepend the cljsExports definitions to the Google Closure :advanced output. Not sure if there's a more elegant approach to this, but this seems to work.

Screen Shot 2019-11-13 at 12 12 50 AM