Fork me on GitHub
#cljsrn
<
2016-07-05
>
tiensonqin05:07:18

Anyone successfully changing the statusbar background color in ios?

tiensonqin06:07:16

@jinsolkn: I think it's {:InitialPage 0}

jinsolkn06:07:50

@tiensonqin: i tried 240min before

jinsolkn06:07:09

@tiensonqin: and statusbar background color in ios is refer to Luno demo app src/ios

tiensonqin06:07:30

I can set statusbar background color in appdelegate.m like:

UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 0,[UIScreen mainScreen].bounds.size.width, 20)];
  view.backgroundColor=[UIColor colorWithRed: 0
                                       green: 0
                                        blue: 0
                                       alpha: 0.85];
  [self.window.rootViewController.view addSubview:view];

tiensonqin06:07:17

I want to dynamically change the color from js

tiensonqin06:07:57

I'm trying to write some obj-c, really know nothing about it

vikeri07:07:27

@pesterhazy: I saw your comments here: https://github.com/facebook/react-native/issues/5196#issuecomment-194311091 Running into the same issue. Did you solve it in a way cleaner than manually patching the react native package?

pesterhazy07:07:18

@vikeri: yeah I "solved" it by using --dev true, which disables whole-program optimizations

seantempesta07:07:00

ah, interesting. I was getting by bumping up the memory allocated to the node process: --max_old_space_size=4096

pesterhazy07:07:27

--dev true it doesn't seem to affect performance too badly, though it's obviously not ideal

seantempesta07:07:31

Does clojurescript cause this to happen more? You’d think that more people would be hitting this problem.

pesterhazy07:07:10

however, it also enables runtime checks which you don't want (e.g. the yellow error message in the app)

pesterhazy07:07:36

for that I just patch out the DEV__ constant on the top of the file

pesterhazy07:07:38

#!/usr/bin/env python

# Patch jsbundle to set __DEV__ to false

import sys, re

print(re.sub(r'__DEV__\s*=\s*true;', "__DEV__=false;",
        sys.stdin.read()))

seantempesta07:07:52

(aset js/console "disableYellowBox" true) 🙂

pesterhazy07:07:28

@seantempesta: didn't know that existed. We should build a knowledge base

seantempesta07:07:30

re-frame was driving me crazy by pushing handler/subscription changes to the yellow box

seantempesta07:07:39

yeah, for sure

pesterhazy07:07:52

yeah I don't like the yellow boxes or red stacktraces at all

seantempesta07:07:57

there are so many little things that you have to learn to do cljsrn development

vikeri07:07:15

Haha true…

pesterhazy07:07:44

@seantempesta: I think the memory issue is a result of the Google Closure Compiler

pesterhazy07:07:11

because it creates an enormous bundle that needs to be consumed by the optimizer

seantempesta07:07:17

It’d be great to have a “best practices” template with code based solutions rather than just a wiki

vikeri07:07:37

@seantempesta: where did you change the —max_old_space_size=4096?

seantempesta07:07:37

@pesterhazy: yeah, that was my guess too

pesterhazy07:07:03

@seantempesta: setting the heap size in node didn't work for me as it didn't affect the worker processes

vikeri07:07:23

@seantempesta: Yes! I have been advocating a common resource for re-natal and boot users.

pesterhazy07:07:45

also almost no-one seems to be setting heap size in the node world, which is quite concerning

seantempesta07:07:13

Xcode: Build Phases —> Bundle React Native code and images —>

export NODE_BINARY='node --max_old_space_size=4092'
../node_modules/react-native/packager/react-native-xcode.sh

pesterhazy07:07:27

ah NODE_BINARY is the trick?

seantempesta07:07:39

I forget where I had to change it in Android

pesterhazy07:07:57

I think I tried that, but maybe didn't do it correctly

pesterhazy07:07:10

I'll give that a shot the next time I run into this issue

seantempesta07:07:15

I guess so? I tried to look into what was failing and almost cried. The current state of babel/babylon just seems like a shit show.

pesterhazy07:07:01

though tbh --dev true also seems to work

seantempesta07:07:08

yeah, good to know

pesterhazy07:07:19

re: best practices, even just a mailing list would help

pesterhazy07:07:30

slack is nice and all but all the info gets lost

seantempesta07:07:53

yeah. I like slack for discussions, but for informational storage I think it’s terrible

pesterhazy07:07:55

= you can't google

vikeri07:07:59

yes, somewhere persistent should be better...

pesterhazy07:07:15

if you guys are interested I'll set up a mailing list

seantempesta07:07:31

I’d sign up and contribute for sure

vikeri07:07:58

Wouldn’t a wiki be better?

pesterhazy07:07:31

a wiki is good for established best practices, but I'm not sure we have those yet in the community

vikeri07:07:10

I find mailing lists not optimal. Having to pan through random answers until I hit the one that actually solves it.

seantempesta07:07:25

stack overflow?

pesterhazy07:07:53

Stack Overflow has great SEO at least

pesterhazy07:07:45

people feel mailing lists are anachronistic but I'm always glad when I find a discussion with different sides online

vikeri07:07:48

@seantempesta: haha true. But it feels less responsive. I generally ask here since I’ll get a much faster response and can discuss the issue. But I guess stack overflow was meant to solve this particular issue.

seantempesta07:07:45

I guess if the person asking the question just copied and pasted it into SO and put a reference to it in the channel, we could just answer it there and take advantage of that whole ecosystem.

vikeri08:07:22

@seantempesta: Sounds like a good solution

seantempesta08:07:16

we could just agree to tag the questions a certain way? #C0E1SN0NM

seantempesta08:07:48

#ios #android for specific platform questions

seantempesta08:07:29

maybe also tag react-native in hopes the wider community might have similar issues?

pesterhazy08:07:01

yeah, the yellow box is an example

seantempesta08:07:40

god I forget where I even found that. I’ve been having to dig through the react-native source code for a lot of things since the documentation is so sparse.

vikeri08:07:21

Hah, tried to create the tag cljsrn, but I don’t have 1500 in reputation so I couldn’t do it. Feel free to add the tag (and the Android solution): http://stackoverflow.com/questions/38198511/how-to-prevent-node-from-running-out-of-memory-when-bundling-js-for-react-native/38198512#38198512

seantempesta08:07:16

haha, you assume I have 1500 points. I’ll add the solution though. Eventually one of us will have enough points to add it. 🙂

seantempesta08:07:08

oh you already did it

vikeri08:07:58

@seantempesta: Yes, at least your iOS solution.

seantempesta08:07:29

when I remember my android fix I’ll post it

pesterhazy08:07:04

I added my workaround too

pesterhazy08:07:01

turns out I also don't have enough karma 🙂

terje21:07:06

Done: I’ve created a tag for ‘cljsrn’ on SO. Glad my reputation points could be put to good use.