Fork me on GitHub
#cljsrn
<
2016-08-16
>
tianshu02:08:56

@vikeri For this kind, check the cljs compile log?

vikeri11:08:16

@doglooksgood: It compiles well but it crashes in runtime...

vikeri11:08:41

@pesterhazy: Any idea why I can’t get REPL nor reloading to work in brn?

pesterhazy13:08:51

@vikeri: haven't tried the repl in quite some time, so don't know what the status is there

pesterhazy13:08:12

but it should be possible to make it work, as it used to work

pesterhazy13:08:40

what I do is to change my on-js-reload fn to prn the result of a function to iterate quickly

pesterhazy13:08:59

obviously a repl would be quicker. Could you make an issue?

pesterhazy13:08:24

boot-reload should work out of the box. What kind of error do you get, if any?

vikeri13:08:04

@pesterhazy: Alright, I don’t get any errors or any indication that the on-js-reload function is happening at all. I tried adding console.log statements to that function but nothing. I’ll create issues in boot-react-native then.

pesterhazy13:08:29

are you looking at the device log?

pesterhazy13:08:43

there's react-native log-ios (or log-android)

pesterhazy13:08:08

that's where you see many of the important messages

vikeri13:08:11

Running on Android atm, but I can change to ios to see if the issue persists.

pesterhazy13:08:19

it should work on android

pesterhazy13:08:48

did you forward the websocket port using adb?

vikeri13:08:34

I’m using the emulator, but no

pesterhazy13:08:49

yes, you need it even for the emulator

pesterhazy13:08:59

as android emulators run in a VM

pesterhazy13:08:14

https://github.com/mjmeintjes/boot-react-native/wiki/Troubleshooting <-- see the section on Problem: console.error "Reload websocket error"

vikeri13:08:22

Ok, did not know that page. Maybe that should be added to the readme section about reloading.

pesterhazy13:08:04

@vikeri: I added a link to the troubleshooting guide to the homepage opening paragraph

pesterhazy13:08:40

@vikeri: TBH I haven't used the Chrome-based debugger much

pesterhazy13:08:03

some time ago I had some problems with it, but I haven't tried it lately

pesterhazy13:08:15

it certainly promises a better debugging experience

pesterhazy13:08:31

I usually just use the Red Screens (do you see those?)

pesterhazy13:08:42

if that fails there's usually something in the device log

pesterhazy13:08:33

the Red Screens are great because you can click on frames in the stacktrace, which opens an editor to the source file

vikeri13:08:46

Ok the reloading works in iOS, but I get the error Requiring unknown module ”../../../app/images/logo.png” when it tries to reload. Strange.

pesterhazy13:08:01

that's a known issue!

pesterhazy13:08:42

what I do is to use (defonce logo (js/require ".../logo.png"))

pesterhazy13:08:56

that effectively works around the proble

vikeri13:08:09

@pesterhazy: Great! Now I’m getting weird issues with my subscriptions not conforming to spec. But that might have to do with something else...

pesterhazy13:08:27

as some point we should look into why re-requiring images doesn't work with boot-reload (I have a suspicion, but am not sure)

vikeri13:08:51

Why not use subheaders for the problem in the troubleshooting section?

pesterhazy13:08:15

yes I was going to do that

pesterhazy13:08:20

so you can link to specific problems

pesterhazy13:08:37

do you have a pointer to an example I can use?

pesterhazy13:08:10

this looks like a good example

pesterhazy13:08:50

@vikeri: did you get anywhere with your attempt to get node_modules into boot fileset?

vikeri13:08:10

@pesterhazy: Great! Nope, the folder is too big to be included, something to do with the attached filewatchers.

vikeri13:08:40

Could use the npm task but unsure of how that affects the rn packager so I skipped that for now...

pesterhazy13:08:18

what npm task do you mean?

vikeri13:08:54

seems my issue with the REPL is also related to the ports

pesterhazy14:08:22

ah boot-npm looks interesting

pesterhazy14:08:34

so a cache-dir is basically a tempdir that doesn't get deleted?

pesterhazy14:08:40

cool, yeah I suspect it'll be hard to make that work with the RN packager, which expects files in a certain location

pesterhazy14:08:54

but would be useful to try at some point

vikeri14:08:08

Sure seems neat

vikeri14:08:52

Another question, the packager task in boot does not seem to work, what does it do that npm start — —reset-cache does not?

pesterhazy14:08:42

it should be removed

pesterhazy14:08:33

IMO npm start is the way to go, especially given that the xcode/android projects automatically start it in a terminal window

pesterhazy14:08:58

originally the idea was to run the packager from inside boot, but that turned out to be an uphill battle

pesterhazy14:08:07

complecting the various stages of the pipeline

pesterhazy14:08:46

quite often you want to restart the RN packager, but the cljs compiler rarely needs to be restarted; so it's better to keep them separate

pesterhazy14:08:14

also, the log output is best kept in a separate window, making things easier to grok for a beginner

vikeri14:08:21

Yes, I agree.

pesterhazy14:08:47

would you mind opening an issue about this?

vikeri14:08:58

Removing packager task?

vikeri14:08:10

REPL not working in Android though, only in iOS. Tried adb reverse tcp:9001 tcp:9001 but it did not help.

pesterhazy14:08:15

an issue would be great, especially if you can reproduce it in SimpleExampleApp

vikeri14:08:00

Hmm weird, the Android app doesn’t even seem to run for me.

pesterhazy14:08:21

what error do you see?

vikeri14:08:35

goog.require could not find: cljs.core

vikeri14:08:19

Right, forgot that step 😬

pesterhazy14:08:48

how about adding a boot task that automatically does that? That'd save people some trouble

vikeri14:08:08

Yes, would be nice.

vikeri14:08:01

Could also add the adb commands when doing boot dev -p android

pesterhazy14:08:42

hm yes, although that again goes against the separation of RN packager vs boot react naitve

pesterhazy14:08:09

ideally the RN team should fix https://github.com/facebook/react-native/issues/9084, but they've never even replied to any issue I've created

vikeri14:08:35

Would it be much effort to do a PR? If not then I’d be happy to endorse it 👍

vikeri14:08:34

The REPL worked in the SimpleExampleApp, so my bad...

pesterhazy14:08:09

a PR to react-native? Not a lot of effort, but the chances of anything getting merged is slim I'm afraid.

vikeri14:08:37

I got one merged, only about docs but still 😜

shader14:08:14

hello! I'm trying to get the boot-react-native example to work, but it doesn't seem that the dev server is running on 8081? The only error I get is "Could not connect to development server" on the device

shader14:08:39

the 'boot dev' output looks similar to what's in the getting started guide

pesterhazy14:08:26

@shader: are you running SimpleExampleApp, and on ios or android?

shader14:08:08

@pesterhazy: Yes; recent clone of boot-react-native/example/app on a physical android device

vikeri14:08:34

Did you run npm start in ./app?

pesterhazy14:08:11

@shader: so normally, if you run react-native run-android, a packager window should open automatically

pesterhazy14:08:31

if it doesn't, you can run it manualy as @vikeri suggested

pesterhazy14:08:53

however, on many machines, retrieving the bundle takes a while when run for the first time

pesterhazy14:08:02

often the app gives up before the bundle is ready

pesterhazy14:08:58

you can try it on the command line using curl -o /tmp/bundle.js "localhost:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false"

pesterhazy14:08:14

if that blocks, you should see some progress in the packager terminal window

shader14:08:58

seems to be working better after "npm start"

shader14:08:52

or at least it's "Fetching JS Bundle"...

pesterhazy14:08:53

@shader: it's faster the second time

pesterhazy14:08:50

@shader: did you make it work?

shader15:08:29

yes; seems to be working now

shader22:08:42

how do you do animations with boot-react-native? though I guess it might apply to any react-native + reagent?