Fork me on GitHub
#cljsrn
<
2016-07-26
>
martinklepsch09:07:56

@pesterhazy: maybe they would take a patch that allows customization of the list of "require" statements, like you can customize the pragma (element builder fn) in JSX to use Preact &c

boorad11:07:39

Why don't they use haste for this part? Just forgot about this part of the default transformer?

pesterhazy13:07:56

@boorad: they seem to be refactoring continuously

pesterhazy13:07:10

it wouldn't surprise me if it got stuck in the middle of a refactoring

pesterhazy13:07:36

loading the app works now

pesterhazy13:07:53

however, reloading (using boot-reload) doesn't work reliably

boorad13:07:43

I was able to get past most of the issues with your patch, but I can’t seem to get the app to load. something about a require error or missing .registerComponent (which I clearly do).

boorad13:07:57

I’ll solve it, then begin looking at boot-reload and other tickets I see in BRN.

boorad13:07:18

I did bump boot-reload to 0.4.12 and boot-cljs-* to more current versions

boorad13:07:53

^^ meaning with my own app, not the example app.

boorad13:07:01

also, I’m using om.next instead of reagent

pesterhazy13:07:34

yeah, om.next vs reagent shouldnt make a big difference

boorad13:07:53

I’ll get past it. I actually have to work at my real job for a bit today 😐

pesterhazy13:07:03

hehe, keep me updated

boorad14:07:44

@pesterhazy: with my error above, I see that the generation of the source maps isn’t working

pesterhazy14:07:01

@boorad: I think that's true

pesterhazy14:07:19

it errors out once it tries to generate source maps

pesterhazy14:07:31

is there a way to disable source maps temporarily:?

pesterhazy14:07:21

yeah we're seeing the same "Found a source and line" error

pesterhazy14:07:20

another question

pesterhazy14:07:43

with the split of react-dom and react, I think we can't use react-dom in react-native anymore

pesterhazy14:07:24

however, reagent.core/render was previously used for boot-react-native to re-render the app on reload

pesterhazy14:07:39

is there an equivalent or ReactDOM.render for react-native?

boorad14:07:04

no clue on that one...

boorad15:07:04

source maps can be turned off in brn/resources/mattsum/boot_rn/js/cljs-rn-transformer.js

pesterhazy15:07:56

can we just skip the cljs-rn-transformer?

boorad15:07:15

I mean, long-term, I’m going to want it to generate valid source maps so I can see where in cljs code I’ve screwed up

pesterhazy15:07:53

yes of course 🙂

pesterhazy15:07:00

ok I managed to get reloading to work

pesterhazy15:07:22

the problem was reagent.core/render not working anymore because of the ReactDOM/ReactNative split

boorad15:07:09

huh, using getBasicMapping still gives source map error 😞

pesterhazy15:07:39

you only see the source map error if there's an exception, correct?

boorad15:07:44

I’ll just write perfect code

boorad15:07:02

ok, omitting cljs-rn-transformer from startup opts on the packager gets rid of the error

boorad15:07:23

so we have a dated getBasicMapping to fix as well, when we get back to cljs-rn-transformer.

boorad16:07:26

@pesterhazy: how does RN identify your main function? I see on-js-reload mentioned in build.boot, and (cljs :main … but that gives me an error.

boorad16:07:55

I feel like I’m not getting to the part of my code that has the AppRegistry.registerComponent

pesterhazy16:07:59

what do you mean by 'main function"?

boorad16:07:05

an entry point

boorad16:07:29

in simple-example, it’d be mattsum.simple-example.core ‘main'

pesterhazy16:07:22

it has

(cljs :main "mattsum.simple-example.core"
         :ids #{"main"})

pesterhazy16:07:28

I think that's it

pesterhazy16:07:47

this is not very pretty -- it should be in an .edn file instead (as in dist.cljs.edn)

boorad16:07:55

cljs: unknown option(s): :main

pesterhazy16:07:25

haha, that's probably because boot-cljs moved towards putting everything in an edn file

boorad16:07:41

like you suggest 🙂

pesterhazy16:07:51

create an edn file in resources called, I think, main.edn

boorad16:07:05

I’ll check out boot-cljs too, thanks

pesterhazy16:07:19

then refer to it using :id "main"

pesterhazy16:07:41

don't rename it, I think "main.out" is still hard-coded in boot-react-native

pesterhazy16:07:53

maybe it's easier to go back to an earlier boot-cljs

pesterhazy16:07:05

otherwise, changing SimpleExampleApp would be appreciated

boorad16:07:24

yeah, once I get productive with my app, I’d like to go back and clean up BRN

boorad16:07:34

knowing that ^^^ rarely happens

pesterhazy16:07:00

I put it off for too long, unfortunately

pesterhazy16:07:08

now I'm hoping to get it back in shape again

pesterhazy16:07:40

SimpleExampleApp's build prints out Writing main.cljs.edn...

pesterhazy16:07:49

I guess that's boot-cljs

boorad17:07:43

and if it exists, like I just tried, then it says Adding :require adzerk.boot-reload to main.cljs.edn…

boorad17:07:24

aaaaand, that did it.

boorad17:07:45

so I’ll owe you some commits to BRN for that.

boorad17:07:57

what do you think we’ll do about develop vs. master branch?

boorad17:07:09

I’m not sure all of your develop commits belong, do they?

pesterhazy17:07:50

no I'd like to clean it up to get it merged (basically squash my WIP commits)

pesterhazy17:07:21

however, it'd be great if @mjmeintjes could weigh in

pesterhazy17:07:05

I've started creating issues for the remaining problems, it'd be great if you could do that as well

martinklepsch17:07:00

regarding source-maps — there are known issues with 1.9.93 so make sure you don't run on that version

pesterhazy17:07:27

@martinklepsch: is there a way to make boot not touch unchanged files?

martinklepsch17:07:39

@pesterhazy: does your dev pipeline always contain target?

pesterhazy17:07:47

because the react-native packager accesses the js files generated and dropped in the target dir

pesterhazy17:07:18

ideally this could be done from boot's tempdir of course, but that proves a not-so-easy refactoring

boorad17:07:16

@pesterhazy: I have #46 included, and am trying to get reloading to work.

boorad17:07:39

I think my issue is where the on-js-reload sends the simulator.

boorad17:07:00

so I’m less convinced #46 has to be backed out. You got reload working, no?

boorad17:07:58

if I can figure out how to call om.next’s equivalent of reag/render for different views I have, then I think it’ll work.

boorad17:07:13

sending back to (main) doesn’t seem to work, maybe because I’m calling .registerComponent again

pesterhazy18:07:14

Check my latest commits for how to call render

pesterhazy18:07:56

Registercomponent should only be called once (though I think it works if you do it multiple times?

pesterhazy18:07:23

I ran into many issues with master

pesterhazy18:07:08

I'm sure it can be made to work but it was too much effort for me at the time