Fork me on GitHub
#cljsrn
<
2017-07-07
>
ronb06:07:21

@joshmiller the last variant should work, are there error messages or does the function get called?

ronb06:07:29

could also be, that the data object has no rows, so renderRow is never called

raspasov09:07:07

did anyone try upgrading or successfully made it to RN 0.46 yet? (I would strongly suggest you either wait or backup your whole project before you try)

raspasov09:07:02

the breakage situation is pretty tough at the moment, and I think it’s not only me 🙂

pesterhazy10:07:51

RN devs are not squeamish about breaking the world

raspasov11:07:25

haha yea no kidding…

raspasov11:07:06

this time IMO they went a little overboard though… I have not tried it but even the default install following all instructions for a brand new project seems broken as reported by a lot of people

gphilipp14:07:15

To anyone using :simple compilation and having solved memory issues, can you please check the memory usage evolution over time of the various nodeprocesses when doing a react-native run-ios --configuration Release and report here ? Can you also include your node version + exact export NODE_BINARY... line ?

seantempesta14:07:50

@gphilipp After a certain code size, I had to use advanced to get react native releases to build without memory errors. Lately, the only setting I have to mess with is:

node_modules/react-native/packager/src/JSTransformer/index.js:

// Worker will timeout if one of the callers timeout.
const TRANSFORM_TIMEOUT_INTERVAL = 30100000;

gphilipp14:07:26

On my laptop, event if I set node --max_old_space_size=8192, the nodeprocess NEVER goes beyond 1.5G of memory usage. That looks terribly like some default value. I would like to know if it’s the same for others.

seantempesta14:07:06

That sounds right (from my memory at least). I wasn’t able to increase the amount of memory usage. The only luck I had was with the garbage collection hack I found (where you manually trigger gc in the transform loop to keep memory usage stable).

seantempesta15:07:04

but that was a while ago and I don’t know if that packager code has been re-written.

gphilipp15:07:20

I used your trick, but it didn’t have any effect (saw the GC messages in the log)

gphilipp16:07:59

> Third, because of the problem described above, node.js puts a hard limit of 1.5 GB on its heap. If your total heap usage reaches 1.5 GB, you will see the dreaded “FATAL ERROR: JS Allocation failed – process out of memory” message. That is not a happy message. It means your application has crashed.

mfikes17:07:16

I’m curious whether anyone has messed with the new :npm-deps ClojureScript compiler option. I tried a little, but started to suspect that it might be at odds with the React Native packager. I didn’t want to spend too much time, so asking.

mfikes18:07:10

I found that :npm-deps can be made to work, but there is a lot of stuff in the re-natal stack that can start to fall apart the more you try to use that way. (For example, I was able to simply have a (:require react) in my ns form, but trying to additionally include react-native caused other issues, and if you try to run things in dev mode, you can get Figwheel to NPE.)

vikeri20:07:18

@mfikes A lot of RN projects are written in ES6 without being transpiled before being published to npm. Does :npm-deps handle that, i.e. will it transpile the library code?

mfikes20:07:16

I don’t know. António Monteiro is the main developer of :npm-deps and much more knowledgeable on that kind of stuff than I.

mfikes20:07:52

My hope is that one day he becomes interested in or needs to write a mobile app 🙂

vikeri20:07:50

Haha ok! In general I think it would be hard to incorporate :npm-deps into the rncljs toolchain without some tweaks due to how the RN packager works. (Scanning the code for require-statements for example).

raspasov20:07:57

@mfikes is the idea to use :npm-deps to avoid using npm separately altogether? (that would be nice)

vikeri20:07:53

A successful implementation of :npm-deps + an undestanding of what the RN-packager does apart from babeling the code could allow for us to cut out the rn packager and serve the files straight from figwheel. I think a lot of work would be needed for that though.

mfikes20:07:57

My thinking was for 2 things: 1) If you use React that way, you can subject it to Closure (DCE, etc.) 2) It might be important for the new string-based require that is in ClojureScript master, which might make using RN components more straightforward (stuff in the ns form rather than vulgar explicit js/require, and goog.object/get calls in code

raspasov20:07:39

1) would be very cool

raspasov20:07:51

@vikeri I have been using RN/packager for a long time but never dug into this - do you know what’s the point of packager doing this require-statements scanning?

vikeri20:07:24

@raspasov Some kind of basic tree shaking I guess.

raspasov21:07:24

@vikeri possible, but i’m not sure either

mfikes21:07:25

@vikeri FWIW, I succeeded in using react without a (js/require "react")

mfikes21:07:44

When doing so, you could see that ClojureScript was pasing React through Closure (because Closure started warning about some things)

raspasov21:07:25

I just tried adding a random react native library through :npm-deps

raspasov21:07:47

ERROR: ES6_FEATURE. this language feature is only supported for ECMASCRIPT6 mode or better: modules. Use --language_in=ECMASCRIPT6 or ECMASCRIPT6_STRICT or higher to enable ES6 features. at /Users/***/node_modules/react-native-fade-in-image/index.js line 1 : 0

mfikes21:07:23

My very earliest attempts at working with RN (back before it was released) was based on the concept of attempting to avoid the RN Pacakager (even Nolen was thinking this way), and we had Ambly compiling directly to the device. But that way leads to challenges. Either you try to stay away from the packager or you embrace it, was the philosophy I came away with.

raspasov21:07:02

(it’s one of the simpler RN libraries this one that I tried https://github.com/expo/react-native-fade-in-image)

raspasov21:07:03

@mfikes yea packager is quite a mess IMO, but it seems very hard to avoid at this moment

raspasov21:07:27

(from my ~1 year experience of RN full time)

mfikes21:07:17

The thing that essentially killed the idea (dunno if it has been addressed), was that React was using Facebook-specific import code of some sort that the Packager knew how to process

carocad20:07:05

mfikes: have you tried using haul? I guess with the current cljs import syntax and code transpilation it might be worth a try, since that is precisely what it doesnt do.

carocad20:07:19

I gave it a try some time ago but failed miserably 😄 Although at that time I didnt use the alpha cljs require syntax which might have helped with the problem of using modules with ES6 syntax

mfikes20:07:41

No, I haven't used haul. To be honest, I'm not up to speed on the JavaScript build ecosystem.

raspasov21:07:30

@mfikes that’s good info, unfortunately I don’t know

vikeri21:07:49

Right, that sounds familiar, haste I think it’s caleed