cljsrn

https://github.com/drapanjanas/re-natal | https://github.com/drapanjanas/re-natal/wiki/FAQ | https://github.com/condense/mercury-app/wiki | https://github.com/seantempesta/expo-cljs-template/ https://www.npmjs.com/package/create-expo-cljs-app
raspasov 2021-05-04T00:12:54.114700Z

I’m guessing you have some locahost/IP issue.

raspasov 2021-05-04T00:13:38.114900Z

Assuming you’re using figwheel-main, what does you figwheel-main.edn look like?

raspasov 2021-05-04T00:14:47.115200Z

Following the instructions here, you should be able to get things running: https://figwheel.org/docs/react-native.html

raspasov 2021-05-04T00:17:46.115600Z

I’ve had issues like this, initially. It seems like everything is compiling fine for you, but at the very end the application is not connecting to the REPL. My figwheel-main.edn looks like this:

{:ring-server-options {:port 9500 :host "192.168.1.62"}}
I’ve found that using the local IP of the network works the best for me, allowing me to connect both from simulators and real devices (that are on the same WiFi)

raspasov 2021-05-04T00:19:07.115800Z

Try compiling for a second time, there’s some weird issue with this, as far as I can tell.

raspasov 2021-05-04T00:23:23.119700Z

@dsp also, I notice you’re using some lein template of “expo”; You should make sure that’s up-to-date or not use it. In general, I would recommend using the standard React Native tooling as much as you can, including to initialize the project structure, etc. That will ensure you’re using most recent versions. Things have somewhat stabilized in the RN ecosystem but still critical IMO to stay on the latest versions. This is very unlike server-side Clojure, where it barely matters if you’re on 1.8, 1.9, 1.10, etc but unfortunately “it is what it is”.

raspasov 2021-05-04T00:25:16.120800Z

I’ve followed instructions here most recently, and they should work for getting a dev setup running with figwheel-main: https://figwheel.org/docs/react-native.html

Dominic Pearson 2021-05-04T07:54:09.121600Z

thanks. sorry, I am in the EU, so fell asleep. I'll give it another go today.

👍 1
dnolen 2021-05-04T12:49:12.124100Z

@dsp from what I've gleaned lurking here recent shadow-cljs, figwheel should all be fine for React dev - I agree with @raspasov points - use latest React, avoid templating-heavy stuff. Krell was useful but flaky for the past year - but we haven't had any problems w/ it with the latest fixes and we're using it on two non-trivial apps at work.

Dominic Pearson 2021-05-04T15:35:29.124900Z

yep, managed to get everything working well enough. now i just need to figure out how react native works, and the workarounds needed for clj.

Dominic Pearson 2021-05-04T15:35:42.125300Z

(already hit a speedbump with pickers)

Dominic Pearson 2021-05-04T15:36:15.126100Z

i suspect using things from the js ecosystem requires actually knowing how those things work, and thus there's no way around learning the js side of stuff for using it in cljs

👆 1
Dominic Pearson 2021-05-04T15:37:00.126600Z

still, the idea of running more-or-less plain clojure on mobile devices is appealing enough to probably be worth the pain

💯 1
dnolen 2021-05-04T16:26:30.127400Z

I think ClojureScript to build mobile apps is in fact a killer app for ClojureScript

1
dnolen 2021-05-04T16:27:03.128100Z

we even build "native" SDKs in ClojureScript for Java/ObjC/Swift and these are dev'ed w/ Ambly

dnolen 2021-05-04T16:27:48.128900Z

I would not use plain RN and the standard mobile platform dev tools are light years behind wrt. collapsing the cycle

dnolen 2021-05-04T16:28:52.129800Z

I haven't tried Dart yet for mobile dev, perhaps the dev loop there is better than RN now?

dnolen 2021-05-04T16:29:08.130100Z

(ignoring the other caveats or reasons you might not use it)

joshmiller 2021-05-04T16:43:17.130400Z

There is currently a ClojureDart project under way: https://twitter.com/BaptisteDupuch/status/1388449877747720192

joshmiller 2021-05-04T16:43:33.130900Z

That would presumably let you build a Flutter app in Clojure

joshmiller 2021-05-04T16:44:11.131500Z

I prefer RN’s model of driving actual native components with JS to the Flutter canvas-type model though

bherrmann 2021-05-04T18:48:20.132700Z

I fiddled with flutter some, it is fast enough and does hot reloading, well enough to be a fairly productive platform (I only tinkered for about 4 work days though.) plus, you can release the same app to all of the 5 major platforms; linux, chrome, ios, android, web

dnolen 2021-05-04T18:59:08.133700Z

@bherrmann my feeling is the hot-reloading is more sophisticated / useful since it's fundamental to the VM - i.e. instance state is preserved

dnolen 2021-05-04T18:59:20.133900Z

and they're not trying to solve that in Flutter

dnolen 2021-05-04T19:11:35.134200Z

@bherrmann I'm assuming no REPL to the running app though?

raspasov 2021-05-04T19:37:05.134300Z

Yes.

raspasov 2021-05-04T19:37:12.134500Z

And yes 🙂

raspasov 2021-05-04T19:38:46.135500Z

@dnolen What do you mean by “native” SDKs in ClojureScript?

naomarik 2021-05-05T09:55:57.137100Z

Yeah I'm also interested in knowing more about this, mainly what kinds of problems this allows you to solve that a normal cljs + RN environment doesn't. Also ambly says it's for iOS, is there a dev version that works with java/android?

bherrmann 2021-05-04T20:56:05.136100Z

Yea, noticeably no REPL. It is very much a static land.

bherrmann 2021-05-04T20:58:16.136300Z

In particular things like manipulating JSON (in my experience) come in two flavors; 1) a handy way to map the JSON to a tree of dart code (static mapping) 2) a bag of values that you to sift through on your own... So I felt like there was no convenient blend of working with information that we take for granted in clojure land... (These memories are from probably 3 months ago)

bherrmann 2021-05-04T21:01:18.136600Z

On the plus side, you could tell Flutter has an absolute ton of people at google working polishing the heck out of it. A lot of things were well done and very high polish.