Fork me on GitHub
#cljsrn
<
2017-09-15
>
raspasov00:09:34

basically it comes down to: throw a bunch of RAM onto it… then it finishes in <5 minutes for me on a modern MBP… I use :advanced cljs, the output ~1.6MB index.ios.js

raspasov00:09:05

@petterik @vikeri the hack I posted might be of interest for prod/:advanced compilation … lmk your thoughts

vikeri06:09:56

Sweet! So you point the output of the compiled cljs to index.android/ios.js?

raspasov00:09:54

on RN 0.48.1 atm

mv01:09:27

Has anyone here used FlatList in cljsrn? Or how do you recommend implementing a 3xN grid of photos?

mv01:09:49

I’ve tried implementing the FlatList examples from RN in cljs, but I’m getting cryptic errors

raspasov02:09:33

@mv I’ve used virtualized list

raspasov02:09:58

and FlatList is a wrapper around VirtualizedList if I’m not messing up the names

mv02:09:06

I think you are correct

mv02:09:50

I’m trying to put a 3xN photo grid in a scroll view, am I overthinking this? Should I just use for inside of the scroll?

raspasov02:09:16

(for… ) like the ClojureScript (for …) ?

mv02:09:04

And flexbox, I assume

raspasov02:09:07

if this will ever be anything longer than the screen height, you really need to use VirtualizedList, etc

raspasov02:09:35

here’s a gist that I did some time back how to use VirtualizedList from ClojureScript, hope it helps

mv02:09:58

Yes, that helps, thanks!

raspasov02:09:04

VirtualizedList is quite good, you should use it

raspasov02:09:57

haven’t had the need for FlatList myself, but I think it just adds extra features which you can relatively easily achieve with the base VirtualizedList

raspasov02:09:28

re: do you need it - yes, otherwise the memory goes through the roof and your app will crash, even on the latest devices

raspasov02:09:46

if you have a list more than 4-5x the screen height

raspasov02:09:55

and it gets worse with older devices

mv02:09:17

Yea, that makes sense

raspasov02:09:33

depends on the size of the images also, but overall just looping views that will always stay mounted is not a sustainable approach for anything past 1x screen height

raspasov02:09:24

I basically started in mobile dev with React Native and one thing that was surprising to me: 500KB image does not take 500KB of ram, it takes WAY more

raspasov02:09:49

it takes many MBs

raspasov02:09:24

this is it’s not specific to RN, all of iOS works like that (I’m not sure about the low level explanation why)

raspasov02:09:41

not sure about Android, I assume it’s similar

mv03:09:46

What are the benefits over re-natal?

seantempesta10:09:35

@psdp: I am for a side project. @mv: Same benefits that expo provides over normal react-native — you don’t have to deal with the native sides of things and can just focus on writing code that works for both platforms. Also, testing code on device is much easier (as is sharing demos with testers), there’s built in ability to skip the app stores for upgrades (as it’s just javascript), built in push notifications, built in crash reporting (via Sentry), and in general a simple API for most needs.

seantempesta10:09:03

There’s very little downside as you can “eject” your project to a normal react-native project if later on down the road you decide you need native code. So basically, a walled garden starting point.

mv11:09:05

Sounds cool

mv11:09:25

@seantempesta a side project… aren’t you the author?

seantempesta11:09:12

Author of the expo template. But @psdp asked who is using it, so I thought I’d answer for what I’m using it for. 🙂

mv11:09:28

Ha. Well I just started a side project in re-natal, might as well give this a shot

mv11:09:48

Can you speak to any of the components that expo doesn’t implement that people might miss?

seantempesta11:09:52

Cool. Let me know what you think?

seantempesta11:09:27

You mean what third party components do I like?

seantempesta11:09:34

Looking at my package.json file, it looks like these are the only third party packages I’m using that didn’t come from react-native or expo. react-navigation (which I wrote a cljs wrapper for), react-native-communications, react-native-radio-buttons, react-native-timeago

mv11:09:54

Ooph. Clojurescript, Javascript, React Native, now Expo. It’s hard to tell where to start looking at docs when you want to implement something

seantempesta11:09:48

Well, think of expo as just a react-native library. When you run exp or use XDE it’s just starting the react native packager. And all clojurescript is doing is compiling down to the main.js file which is then read by the react packager.

seantempesta11:09:57

It’s confusing at first, but you’ll get the hang of it. 🙂

mv12:09:40

@seantempesta is there an example app anywhere that uses this template? So far there don’t seem to be any uses of Expo in the template…

seantempesta12:09:44

@mv: not sure what you mean? Like examples of using the expo api specifically?

seantempesta12:09:10

I have a demo app showing navigation using expo on my cljs-react-navigation library