cljsrn

Nim Sadeh 2023-07-25T04:00:53.894689Z

Hello, I am new to Clojure, having picked it for native development. I am exploring all the current offerings. I am working with Krell right now, and I get the following non-fatal error when starting on iOS: Any idea what it is?

Jesse 2023-07-27T20:37:55.971379Z

You can also disable Hermes in your react-native project: https://github.com/vouch-opensource/krell/issues/153

Jesse 2023-07-27T23:21:10.884219Z

But :langauge-out :es5 in build.edn seems to be the better option 👍

joshmiller 2023-07-25T21:42:28.115029Z

@nnnsadeh You can also just disable Hermes, see e.g. here: https://github.com/joshuamiller/react-native-template-cljs-krell-storybook/commit/6b13ae61a511d7079746bc3f63430fcba52f70a0

🙌 1
Nim Sadeh 2023-07-25T23:19:04.316839Z

@thheller I don't see any such option in krell unfortunately @joshmiller it appears Hermes has a bunch of advantages I don't want to give up on

Nim Sadeh 2023-07-25T23:26:02.529309Z

Actually I misunderstood - it's a cljs setting, not a krell setting. I added :langauge-out :es5 to build.edn and that got rid of the issues.

👍 1
thheller 2023-07-25T05:40:02.944139Z

react-native somewhat recently switched to use the Hermes JS engine as the default. That engine does not support the use of const which the namespace you highlighted likely wants to use. I don't know how you tell krell to output es5 code by default, but look for that.

thheller 2023-07-25T05:40:17.507389Z

something like :language-out should be documented

👍 1
Kent Bull 2023-08-08T20:34:18.679279Z

Also beware the Hermes engine lack of full WebAssembly support. If you use any Rust cryptography libraries you won’t be able to use React Native. That’s okay because you can always switch to using Ionic and Capacitor, which is better than Expo Go if you end up needing to write custom plugins: https://marko.euptera.com/posts/ionic-clojure.html https://github.com/markokocic/ionic-clojurescript-todo

Kent Bull 2023-08-08T20:36:32.116119Z

If base React Native works for you then knock yourself out with @pez’s great template: https://github.com/PEZ/rn-rf-shadow That worked great for me. By no fault of his own I had to discard my work using that Repo since React Native’s Hermes engine doesn’t support the WebAssembly I am required to use. There’s the https://github.com/cawfree/react-native-webassembly library though that didn’t solve my issue, likely because the cryptography libraries I was trying to use need more than one memory region and this library only supports a single memory region: > Currently, wasm3 https://github.com/wasm3/wasm3/blob/772f8f4648fcba75f77f894a6050db121e7651a2/source/wasm3.h#L214. This means that WebAssembly files which contain multiple memory allocations are not currently supported.