Fork me on GitHub
#cljsrn
<
2018-03-23
>
daveliepmann06:03:15

Hi folks, I'm trying to get CIDER connected to an out-of-the-box re-natal app. Are these steps correct? 1. react-native run-ios >> /dev/null (wait for simulator to start) 2. lein figwheel ios 3. cider-connect -> localhost -> 3449 (matching figwheel's "Figwheel: Starting server at http://0.0.0.0:3449" message)

daveliepmann07:03:02

on CIDER 0.16.0 with no other middleware

carocad10:03:06

hey guys, have anyone used/created react navigation with cljs? I am looking for a stateless router but I havent been able to find anything 😞. Right now my routing state is reseted on every file saved

carocad10:03:52

@vikeri that is the one that I am using but it is stateful, right?

vikeri10:03:28

What do you mean by stateful?

carocad10:03:53

well, if you use figwheel and change a file, the navigation state gets reseted to the root

vikeri10:03:06

Hmm, not for me

vikeri10:03:28

The state is stored in re-frame so it doesn’t reload for me

carocad10:03:17

do you have an example that I can look at? and do you use the navigate and goBack functions?

vikeri10:03:23

Unfortunately no, but describe your issue clearly and file an issue in the cljs-react-navigation lib

vikeri10:03:46

This issues sounds familiar but I can’t remember the solution

carocad10:03:10

@vikeri I just found this out: https://github.com/seantempesta/cljs-react-navigation/blob/master/src/cljs_react_navigation/re_frame.cljs are you using re-frame or just pure reagent? I am just using reagent so I guess that is why I am loosing the state :thinking_face: ?

vikeri10:03:42

@carocad Yeah I’m using re-frame.

pesterhazy15:03:02

@daveliepmann that seems right. What issue are you running into?

pesterhazy15:03:36

You need to reload the RN app once figwheel is done (it says something along the lines of "Waiting for app to connect...")

daveliepmann17:03:33

@pesterhazy the issue is that nREPL connects and immediately poops out. Messages buffer output incoming...

daveliepmann17:03:36

[nREPL] Establishing direct connection to localhost:3449 ...
[nREPL] Direct connection to localhost:3449 established
nrepl-send-sync-request: Sync nREPL request timed out (op clone id 1 time-stamp 2018-03-23 17:59:39.318810000)

daveliepmann17:03:59

the entirety of nrepl-messages localhost is:

daveliepmann17:03:03

(-->
  id         "1"
  op         "clone"
  time-stamp "2018-03-23 17:59:39.318810000"
)

pesterhazy17:03:37

well, figwheel in re-natal works the same as with regular CLJS development

daveliepmann17:03:09

However—I did not reload the app, because after "Prompt will show when Figwheel connects to your application" was immediately followed by the prompt without me reloading: "ios:cljs.user=>"

pesterhazy17:03:27

yeah, that means that you're connected (doesn't hurt to reload though)

pesterhazy17:03:03

Figwheel is just a Clojure process, so the first thing I'd do is to try to connect with lein repl or similar

pesterhazy17:03:59

I don't use nREPL with CLJS very much (as you know), but essentially the process should be the same as what you do in the Browser

pesterhazy17:03:25

Try using cider-connect instead of cider-jack-in, if you haven't done that

daveliepmann17:03:07

I see the instructions for lein repl

daveliepmann17:03:20

and I am using cider-connect

pesterhazy17:03:23

Does lein repl :connect work? That's the first thing I'd try

pesterhazy17:03:25

Are you using the scaffolding geenrated by re-natal init?

pesterhazy17:03:47

it definitely should work 🙂

daveliepmann17:03:09

trying something now

daveliepmann18:03:45

In the interest of future folks who may encounter my question, what Paulus and I found was that trying to cider-connect to an existing figwheel REPL will not work. I had been thrown off by the README's instruction to use lein figwheel ios from the terminal, and trying to connect to that—don't do that. What does work is lein repl from the terminal, cider-connect to that (on whatever port it uses, not figwheel's 3449), then in CIDER's repl evaluate (start-figwheel "ios"), then you have editor integration. You can also do it directly from CIDER: 1. C-c M-j / cider-jack-in 2. from CIDER repl, (start-figwheel "ios"). Cheers.

💯 4