Fork me on GitHub
#cljsrn
<
2016-09-28
>
tiensonqin06:09:12

@artemyarulin @pieterbreed I’m using the exponent template for two projects, so I think it works for me(I’m using re-frame, will support om-next and rum later, PR welcomes).

tiensonqin06:09:57

@artemyarulin @pieterbreed Exponent is much more easier for RN beginners, since you just write the cljs (javascript) part.

tiensonqin06:09:12

You can’t write native codes by design.

tiensonqin06:09:42

Meanwhile since the code is open source, you can fork yourself to add custom native modules later.

artemyarulin06:09:54

>You can’t write native codes by design. @tiensonqin Ahhh, now I got it - yeah, this approach may work better in the start

artemyarulin06:09:49

although I’m not sure it’ll work in a long run - many people here have at least some part of native logic here and there

artemyarulin06:09:20

but thx again for the template - it makes starting with RN+CLJS even easier, cool

tiensonqin06:09:17

Exponent is basically tools built on top of RN, they believe that it's possible to build most apps without ever needing to write native code, provided that you have a comprehensive set of apis exposed to Javascript.. The pros (Simple): 1. You can easily share your app or components. Say you publish your app or component through XDE, then you get a link, for example https://exp.host/@tiensonqin/lymchat, then you can share that on slack or twitter, people can then open this link in their devices. Way better than testflight! 2. No need to open xcode or android studio, No need to handle xml, plist files, No need to write native codes, this is double sword. 3. Smooth RN(the exponent fork) upgrade. The exponent team is responsible for this, backward compatibility stuff. The cons (rigility) 1. Like I said, the only problem for me is writing your native modules or even including 3rd-party native modules is not that easy for now. As far as I know, they are really working hard to add more native modules (google signin, sound, sqlite, realm, ...etc), also they are really working around this problem: https://blog.getexponent.com/answered-on-slack-ejecting-from-exponent-154bdca57dc1.

tiensonqin06:09:51

@artemyarulin Yeah, that’s really the only problem for me now.

tiensonqin06:09:21

btw, @nikki works on exponent, he can answer about exponent.

tiensonqin06:09:47

I actually think exponent is like browser for native.

tiensonqin06:09:03

It’s hard to archive, but it’s exciting.

artemyarulin06:09:30

Hm, interesting, thanks for the info. For me it’s not possible unfortunately to use it (for now at lease) - I’m gradually migrating existing iOS project to RN, so my setup is quite custom with a lot of native code.

artemyarulin06:09:57

btw - they have custom IDE

tiensonqin06:09:10

No, they don’t have custom IDE

tiensonqin06:09:20

I’m using Emacs myself.

tiensonqin06:09:41

that’s XDE, their development tools, for publish, read logs

artemyarulin06:09:54

Ahh, got it, my mistake 🙂

artemyarulin06:09:09

IDE XDE you know, made wrong assumption 🙂

tiensonqin06:09:35

No worry, exponent is not suitable for every scenario currently.

artemyarulin06:09:12

Yeah, even RN is quite young and rough sometimes, but it’s great that we have choise

tiensonqin06:09:27

Yes, I just want to make it easier for developing RN in cljs.

tiensonqin06:09:48

Btw, anyone can successfully adding images or external modules without refreshing?

vikeri07:09:02

@tiensonqin I really like your idea of lowering the barrier! Nope.

vikeri08:09:24

@pesterhazy @mjmeintjes Any idea why the REPL throws Websocket REPL error: occupied on Android and not on iOS? I created an issue: https://github.com/mjmeintjes/boot-react-native/issues/73

pesterhazy08:09:14

Websocket REPL error: occupied what does that even mean?

pesterhazy08:09:24

what version of RN are you on?

pesterhazy08:09:44

I had working reload on 0.30

vikeri08:09:48

0.33, but tried it in the example project on 0.30

vikeri08:09:08

The reload works, the trouble start when I start a REPL

pesterhazy08:09:21

ah so it's about cljs-repl

pesterhazy08:09:39

or about reloading once the repl is connected?

pesterhazy08:09:05

have you done adb reverse for all ports required?

vikeri08:09:46

It’s just really weird that it works for iOS but not for Android...

pesterhazy08:09:15

so I didn't test repls thoroughly tbh

pesterhazy08:09:12

the reason being that 1st cljs repls hard to get running and 2nd in my experience they're still a bit wonky (even a browser repl)

pesterhazy08:09:24

but no doubt it would be great to be able to repl in

pesterhazy08:09:05

what I usually do is just to add something to my on-js-reload fn, save and let boot-reload do the job

pesterhazy08:09:16

not particularly elegant, I know 🙂

vikeri08:09:09

The problem is I have a bunch of complicated data structures I’m working with, so then the 6 second iteration time is not really cutting it. I need the instant feedback loop of the repl.

pesterhazy08:09:42

yeah I know that feeling

pesterhazy08:09:46

even 6s is too much

pesterhazy08:09:03

(if it's any consolation, for me it's more like 12s)

vikeri08:09:28

Yeah that sucks...

vikeri08:09:10

Well, I’ll investigate some more and report back if I find anything.

pesterhazy08:09:48

possibly something todo with android websocket impl

pesterhazy08:09:51

but hopefully not! 🙂

vikeri08:09:16

Let’s hope not 😬

vikeri11:09:10

Ok I think the issue is that when you reload the app the websocket for the REPL is still open and when weasel then tries to connect a new websocket it can’t since it’s already connected. I.e I think pesterhazy was right about the ws implementation in Android 😢

pesterhazy12:09:34

@vikeri so you can't open multiple ws connections at the same time?

pesterhazy12:09:04

you could try that with just a minimum repro case using plain js

vikeri12:09:17

@pesterhazy Never worked with websockets, but from the logs in Chrome it looked like some socket ”address” or something was already occupied, thus the error.

pesterhazy12:09:46

android on ws seems to have some remaining issues according to https://github.com/facebook/react-native/issues/8949

pesterhazy12:09:48

could it be that you have both android and ios simulators open? 🙂

pesterhazy12:09:13

and they both try to connect to the websocket (where only one can connect at the same time)

pesterhazy12:09:21

but possibly something like that

vikeri12:09:43

I think it’s something with Android not clearing up the sockets when the js code is reloaded.

vikeri12:09:39

But tbh I don’t have the competence to debug nor ws errors in Chrome/Java nor weasel and can’t prioritize researching it either...

pesterhazy12:09:22

yeah not my favorite thing in the world either

pesterhazy12:09:30

but glad to hear you made it work on iOS

pesterhazy12:09:37

I should try to get that working again

vikeri12:09:52

Didn’t get it working, it just worked 😛

pesterhazy12:09:53

it's kinda cool to just go (swap! state assoc :foo :bar)

vikeri12:09:17

@pesterhazy Yes, one of my main draws to clojure..

coyotespike19:09:36

Has anyone ever had a card-stack quit rendering the header on them? I made an AwesomeApp and then dropped in Cljs. Everything about the cardstack works except the :render-overlay key, so the header is just blank. But the code looks just like @vikeri's example in re-navigate. Maybe it's Xcode 8?