This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-03
Channels
- # aws (1)
- # beginners (5)
- # boot (46)
- # cider (6)
- # cljs-dev (421)
- # cljsrn (74)
- # clojure (77)
- # clojure-greece (1)
- # clojure-italy (7)
- # clojure-russia (12)
- # clojure-serbia (42)
- # clojure-sg (1)
- # clojure-spec (10)
- # clojure-uk (38)
- # clojurescript (40)
- # core-async (14)
- # data-science (1)
- # datomic (18)
- # emacs (2)
- # events (1)
- # garden (4)
- # gorilla (4)
- # graphql (5)
- # hoplon (69)
- # luminus (1)
- # lumo (1)
- # off-topic (31)
- # om (31)
- # om-next (2)
- # overtone (3)
- # pedestal (1)
- # precept (4)
- # re-frame (23)
- # reagent (2)
- # remote-jobs (1)
- # ring-swagger (23)
- # rum (7)
- # spacemacs (7)
- # sql (4)
- # unrepl (9)
- # untangled (5)
- # vim (11)
- # yada (5)
@paulbutcher in fact they can be shared, I just have a one-liner in both ios/core.cljs
and android/core.cljs
: shared.views/init
where the shared.views
namespace lives under src
.
Thanks @gphilipp - much appreciated.
Just spent an hour of my life adding a launch image. Thanks XCode
@pesterhazy I’ll be interested, can you describe how ?
@gphilipp https://stackoverflow.com/a/26156827/239678 this is the guide I followed
I still don't understand the difference between Launch Image and Launch Screen
@mfikes @pesterhazy @raspasov I’ve done some experiments with using react-native-externs
and changing the way to access props and both failed when using :advanced
mode. My results are here : https://github.com/gphilipp/future-app/blob/master/README.md, the logs are on their respective branch.
you missed a spot https://github.com/gphilipp/future-app/blob/using_google_object/src/future_app/ios/core.cljs#L10
@pesterhazy true ^^
@pesterhazy Good catch, I fixed it. But now I have a different error:
is not a function. (In '("FutureApp", function () {
if (!t(tp)) throw Error("Assert failed: c");return Tl(tp) ? tp : hm(tp);
})', '' is undefined)
2017-07-03 11:48:04.698 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: is not a function. (In '("FutureApp", function () {
if (!t(tp)) throw Error("Assert failed: c");return Tl(tp) ? tp : hm(tp);
})', '' is undefined)
In index.ios.js
: return
probably this line (.registerComponent app-registry "FutureApp" #(r/reactify-component app-root))
what’s wrong with it ? @pesterhazy
same problem
try
((gobj/get app-registry "registerComponent") "FutureApp" #(r/reactify-component app-root))
hang on...
not saying this is pretty 🙂
(.call (gobj/get app-registry "registerComponent") app-registry "FutureApp" #(r/reactify-component app-root))
that's the one 🙂
that said, @mfikes is probably right that the externs file is the more straightforward solution here 🙂
@pesterhazy Thanks, i’ve updated the branch: https://github.com/gphilipp/future-app/commit/f9a183476355835e25cfa71edf23d56bd8d963af
I think it's useful to go through the motions of using gobj/get to fix theses issues, just to understand how Closure's minifier works
Yeah, i’m onto the react-native-extersn branch now 😄 I think I have a lead, ReactNative.TouchableHighlight = {}
is missing from the react.native.ext.js
file in react-native-externs-0.0.1-SNAPSHOT.jar
/cc @artemyarulin
@pesterhazy I fully agree. I have a much better understanding now.
please consider making a PR to reagent for that assert
it bites every react-native user. IMO it should come with a proper error string (second arg to assert
)
the other thing is that apparently the stack traces are missing from your logs
https://github.com/artemyarulin/react-native-externs/tree/c1520a7567f1122aca1ccdff30df24f2e96ef383
that's an issue that I've seen many times before
I think the stack trace is available (if garbled), but it gets swallowed somehhow
sweet
haha, you're being bitten by all the classics
I'd try setting the available memory for node first
My app is composed of maybe 10 screens, I use a few libs (react-native-vector-icons, react-native-swiper, react-navigation, react-native-datepicker), and since I upgraded from react-native:0.44.2 to react-native 0.45.1 I can’t build my app anymore in the production profile with :simple
. It fails with an out of memory error. I had of course updated the NODE_BINARY environment variable in project.pbxproj like this node --max_old_space_size=8192
.
you can try my DEV__ hack (if you scroll up)
Something which is weird is that when trying to use the GC trick https://github.com/facebook/react-native/issues/5196#issuecomment-237549879 from @seantempesta, I see Garbage collection is not exposed
in the build log even when I adjust the NODE_BINARY variable to read node --expose-gc --max_old_space_size=8192
.
I wish we could solve this once and for all
oh you may also want to explore disabling optimizations in .babelrc
not sure if that's even relevant for react-native bundle
but worth a try
Ok, I’ve some news. I had tried to use advanced compilation in my big project, but I still had the dreaded Assert failed: c
error. I didn’t want to go through all libraries I use and declare externs. Then I remembered that ClojureScript now can infer externs since 1.9.456 (https://clojurescript.org/guides/externs). So I just added :infer-externs true
in the production profile in project.clj
just above :optimizations :advanced
and now it works perfectly, no more memory issue. So I didn’t fix the memory issue, I just avoided it. thanks @raspasov @mfikes @pesterhazy
Nice! Totally forgot about that
@drapanjanas maybe this could be added in the next version of re-natal ?
@gphilipp yeah, its easy to change template in re-natal :) if it works - fine with me. I'm a bit busy with work lately, there are pending changes to release already.. but i can look into this next
Oddly, even if enabling extern inference, I still have to use the react-native-externs
library otherwise I get this error
[error][tid:com.facebook.React.JavaScript] undefined is not a constructor (evaluating 'new d9.ListView.wh(Rx(new Cr(null,1,[K1,function(n,t){return XE.b(n,t)}],null)))')
@pesterhazy All right, I think I’ve nailed it.
@gphilipp do tell
@pesterhazy since RN 0.45 you now have to set an additional flag to the node process: --max_new_space_size 512
. I’m currently doing some time measurements with various values of max_new_space_size
and max_old_space_size
. I’ll post them here, and on my repo (https://github.com/gphilipp/react-native-with-clojurescript/blob/master/README.md)
thanks, that'll help a lot
how did you discover this?
I had found about this option a few days ago when reading a few blogs here and there but all of them stated that it had no meaningful effects compared to the max_old_space_size
option. I should have known better, the devil is in the details 😈
@pesterhazy I’ve discovered neat stuff. You don’t even need to set max_old_space_size
is this your latest update? https://github.com/gphilipp/react-native-with-clojurescript/blob/master/README.md#memory-issues
I didn’t notice but max_new_space_size
has been removed in node 8 https://github.com/JaraLowell/OgarServ/issues/114#issue-141618013
So, all my builds succeed but they have this line in the logs : node: bad option: --max_new_space_size=2048
in the logs. I think the simulator may have happily launched the last well build version (which used :advanced and :`infer-externs true`).
yeah that's happened to me before
very annoying if you think you're making progress but really you're just seeing a shadow