Fork me on GitHub
#cljsrn
<
2017-05-18
>
kurt-o-sys07:05:37

Hey all, more a thought than a question. I don't really know exactly how re-natal wraps RN, but recently (like a few minutes ago), I had an issue with MultiDex for a rather small project (only used 3 external packages: StripeReact, ReactNativeOneSignal and ReactNativeMapboxGL). I wonder if the multidex could be enabled by default. It's a bit a mess to do it manually (especially for novices - fiddling with Java classes is not really something called 'fun'). - https://developer.android.com/studio/build/multidex.html

vikeri07:05:00

I got the idea to do simple optimizations of my app to have a single file for production. But it seems to be too much for the RN packager… It times out after 300 seconds. Any tips on how to get a good production build?

thheller07:05:57

haven't tried it yet but haul seems very promising as it doesn't process the CLJS code so heavily (thus no slowdown)

vikeri07:05:34

Interesting!

vikeri10:05:14

@thheller Haul didn’t manage to process the file either, it ran out of memory…

pesterhazy10:05:54

@vikeri what I do is to disable whole-program optimizatitions

pesterhazy10:05:17

basically I use the bundle step with --dev

pesterhazy10:05:33

the downside is that it sets __DEV__ to true

pesterhazy10:05:50

in the resulting js bundle

pesterhazy10:05:27

but you can manually go in and replace that string

pesterhazy10:05:34

hacky as hell but it works

pesterhazy10:05:06

you can also try to give the node process more RAM (it's capped to 1GB (?) by default)

pesterhazy10:05:19

people have done that with varying degrees of success 🙂

thheller10:05:25

is there a resource of sorts where current problems with react-native + CLJS are collected?

thheller10:05:44

some react-native templates seem to include a lot of hacks to make things work

vikeri10:05:48

@pesterhazy Ok interesting. It’s actually not the memory that is the issue for the packager, it just times out trying to transform the file. I wonder what optimizations that are most valuable, google closure or rn packager…

pesterhazy10:05:36

@vikeri it doesn't matter that much anyway... bundle size is not very important for apps

pesterhazy10:05:48

you could try disabling transforms in .babelrc

pesterhazy10:05:03

that's also been known to help... sometimes

vikeri10:05:14

I did, and then it sort of worked to serve files, but not to bundle it…

carocad21:05:52

@pesterhazy I just found this out from the react-native issues: https://github.com/pesterhazy/boot-react-native/blob/develop/example/rn-goog-require.patch Any reason why you didnt continue with it?

pesterhazy22:05:45

It's included in boot-react-native and works alright there. What do you mean by continuing?