Fork me on GitHub
#cljsrn
<
2020-04-23
>
axel14:04:23

I have a little trouble getting the minimal example on https://reactnavigation.org/docs/tab-based-navigation to work with krell. Maybe it's just handling of node_modules and making them accessible to Clojurescript. I'd be wonderful if someone could show me how to do it in the context of krell. I must be missing something obvious...

dotemacs14:04:28

@axel.schuessler that’s a bit of a open question, there could be so many details there. In any case, this is a good example on how to get react-navigation going. It is set up with shadow-cljs, but once you require the node packages I’d say that the rest should be pretty much the same with krell. Have a look: https://github.com/eihli/cljs-react-native-starter/blob/master/src/example/core.cljs

Shako Farhad14:04:40

I have a question guys: Why don't we just use react native's modals for navigating smoothly between views? I mean, why can't the application just be a single paged one instead of using stacks and having several views? 😮

dotemacs14:04:07

Well isn’t that up your requirements? You can navigate the way you think it makes most sense for you & your potential users.

Shako Farhad15:04:10

I see. I just thought maybe the community had figured something out that I didn't know. 😮

Shako Farhad15:04:39

Maybe there was some performance reasons for using these stack based navigations. Good to know that it is all preference 😄

dnolen16:04:44

@axel did the tutorial work for you? if so then what specific problem are you having?

axel16:04:20

@dnolen The tutorial works for me. Perfectly. Thanks for asking. REPL on the simulator (for now only tried iOS) works like a charm for me. I just struggle to get node modules required. And this again might be only me not yet understanding how React Navigation works wrt to @bla and bla imports (with and without the at-char) on the Javascript side and how that translates to Clojurescript requires.

dnolen16:04:55

@axel for scoped libraries you have to use strings for the require in the ns form

axel16:04:07

I mostly use Clojure (not Clojurescript) and wanted to shortcut using RN with JS first and jump directly to Clojurescript instead. And now I'm bothering you with noob questions. Sorry. 😔

dnolen16:04:37

note that some libraries export default there's no special handling for this - so you may need to go through that property

dnolen16:04:26

(.. foo -default -apiThing)

axel16:04:12

Ah, thanks for the hint.

dnolen16:04:54

@axel good luck, I think RN while cool / useful - is kinda the deep end

axel16:04:17

🙂 Yes, that's my impression so far. I'm considering native mobile apps for my web app (which is not based on react as one could guess).

dnolen20:04:50

about to remove all the Bonjour discovery stuff from Krell - I went down this path to avoid hard coding the IP/port in the client code because I had a good experience with Ambly but my experience w/ this approach on Android so far as been very low

dnolen20:04:16

I switched to writing out the ip / port into the REPL code, and this works all the time and quickly in all cases

dnolen20:04:38

I did change the code a bit so the REPL publishes an Bonjour service, if the device sees that it will take the updated information and reconnect - but this of course is just extra - the fundamental thing is more reliable

👍 16
dnolen20:04:35

it also means no more adb command so REPL on Android is better

dnolen20:04:42

fewer things to forget

👍 12
dnolen20:04:19

also the order of starting things doesn't matter any more

Michaël Salihi22:04:38

@dnolen is on fire! 🔥

💯 4
dnolen22:04:04

@admin055 everything should be more reliable for you

dnolen22:04:21

I worked w/ Android simulator/device most of the day and the behavior is much improved

Michaël Salihi22:04:02

My last succed test was on real android device. Emulator was'nt work, so I'll retest later. Thx

dnolen22:04:14

@admin055 that would great, both cases could connect in a few seconds now when I tried several times today

👍 4