Fork me on GitHub
#cljsrn
<
2016-08-31
>
tianshu02:08:27

how can I use dist.js to build a release apk for android with boot-react-native?

pesterhazy08:08:04

@doglooksgood, tbh I haven't done that yet for android

pesterhazy08:08:34

it should be straightforward though

pesterhazy08:08:58

for iOS you add the bundle.js to the app bundle

pesterhazy08:08:13

I'm sure it's just a matter of slightly poking the gradle configuration

pesterhazy08:08:32

@doglooksgood let me know if you make progress on this, I'll need it in a week too

vikeri08:08:04

@doglooksgood I did this in app/android/app/build.gradle/:

project.ext.react = [
        entryFile: file("../../index.dist.js"),
]

apply from: "../../node_modules/react-native/react.gradle”

vikeri08:08:00

And then I did this in index.dist.js:

'use strict';
global.ReactDOM = require('react-native');
require('./dist/dist/main.js');
my-ns.core.main();

vikeri08:08:37

And ultimately I put my dist build in dist/dist in boot

coyotespike15:08:51

@pesterhazy: re: cookbook, thanks for the PR!

pesterhazy15:08:23

I was thinking of putting one up for Navigator

pesterhazy15:08:43

using is a bit tricky because of the js interop

pesterhazy15:08:01

also because it's conceptually borked

coyotespike15:08:37

That's not a bad idea at all... I'd also like to include @vikeri's and @weltan's examples.

coyotespike15:08:50

You can see the issue I've opened on weltan's here: https://github.com/weltan/navigation/issues/1. We have to use JS to access the re-frame database - not sure if that's the part you're calling conceptually borked, but I sure think it is! 😵

weltan16:08:16

Really like the idea of a cookbook @coyotespike, and happy to have my repo in there, let me know if you’d like a PR, or feel free to modify the example too and stick it in there yourself. I agree that testing is important: I spend a huge amount of time finding “recent” examples that work in the most recent iteration of RN. What are you thoughts for the cookbook on Android vs. iOS support?

coyotespike16:08:59

Thanks @weltan! If you have time, you could drop it it in a folder and make a PR. I'm happy to write up a tutorial explaining how it works with re-frame.

weltan16:08:12

Excellent.

coyotespike16:08:17

(I have already taken the liberty of adding you and vikeri as contributors, as whether or not your code winds up in there I thought you both deserved credit for figuring it out!)

weltan16:08:00

vikeri deserves all the credit - never would have figured out how to even use Experimental without his code, heh. Like pester says, it’s super borked.

coyotespike16:08:51

For Android vs. iOS - just going off the top of my head here. Support for both would be optimal, obviously, OTOH if someone's only developing for one platform and doesn't have time to test on the other, I'd rather have the example. Someone else can adapt for the other platform, and hopefully contribute the adaptation. Thoughts?

weltan17:08:44

makes sense. also - what do you want me to call the top level folder? scenes?

coyotespike17:08:19

Maybe just navigator. If we have multiple examples they can all go in there, and then we could move yours into a folder called scenes within navigator. simple_smile

artemyarulin18:08:38

For testing on iOS I recommend Travis - it’s free for open source projects and especially now when latest images with xcode has JVM already, so it’s a matter of brew install leiningen && npm install for setting up environment

artemyarulin18:08:41

and it should work for Android as well, although I haven’t tried

coyotespike19:08:53

oh nice, I'll try to add that!