Fork me on GitHub
#cljsrn
<
2016-03-22
>
artemyarulin06:03:26

@drapanjanas: (or anybody else) Have you checked RN hot reloading? Is it any good? Just wondering if we can drop figweel approach and use the existing one

drapanjanas06:03:36

@artemyarulin not yet, but it is interesting how it works. Though, I got impression (I did not measure anything, just felt like) that Figwheel reloads/reacts faster when HMR is off and packager is not watching files (started with —nonPersistent option)

vikeri07:03:02

@jellea: The problem was that I had enabled ”Live Reload” in the simulator’s debug menu...

jellea07:03:02

@vikeri: oh lol, yeah that wont work. Would be good to document somewhere, bumped into that one time as well

vikeri07:03:35

I’ll do a pull request to boot-react-native and add it under the Hot Reloading header

michaelr10:03:22

drhops: we've started using realm https://realm.io/

vikeri11:03:10

@michaelr: How do you work with Realm, writing on each event and then just loading everything into an atom at startup or do you read directly from realm (skipping the atom entirely)?

michaelr11:03:44

well.. we've just started, so far i've only been reading data from realm and passing it forward without updating the state atom

michaelr11:03:14

we're using om.next here and so far it made sense

artemyarulin11:03:42

@michaelr: Curious - are you using re-natal?

michaelr11:03:53

artemyarulin: yes

artemyarulin11:03:44

how do you like it so far? I mean om-next? In theory it should be the best for the mobile

michaelr11:03:27

so far it's been a pain to understand some of the concepts and to find the right approach.. check back in two weeks and i'll tell you better simple_smile

petterik12:03:42

@jarradhope: Here's where I'm at right now: https://gist.github.com/petterik/4a80bd5ecba37ed1ea71 Not sure what flaws this approach has. It's based on subquery routing found here: http://anmonteiro.com/2016/02/routing-in-om-next-a-catalog-of-approaches/

artemyarulin12:03:38

@michaelr: I’ve been straggling with om-next understanding for 3 months already 😄 But I hope you will get it faster. Are you going to use backend?

michaelr12:03:14

artemyarulin: yes but only for a few things.. most of the data would be on the device

jarradhope12:03:04

thanks @petterik taking a look now

seantempesta19:03:42

I really gave om-next a serious eval and it just didn’t seem baked enough to use in a react-native project unless you didn’t plan on interoperating with existing react components. So you’d have to write your own router, tab system, etc. That was just way too much for me to take on.

seantempesta19:03:47

Hey, does anyone here have an elegant solution for using ListView’s? I really don’t understand why Facebook is requiring that we create a datasource as a plain javascript structure. Are you guys just converting back and forth between the list-view and the render-row?

jellea19:03:20

seantempesta: I keep the data outside of the DataSource and on render (after equality check of data) call clonewithdata with the data. Seems most performant and flexible

jellea19:03:24

Anybody using the ExperimentalNavigator already? Think the redux like approach will be a good fit for cljs

seantempesta19:03:07

@jellea: Do you have an example? I’m not sure I follow you.

jellea19:03:17

sure one sec

seantempesta19:03:13

I took a look at ExperimentalNavigator and couldn’t follow the code. I’m hoping to create a cljs react-native router once I am able to wrap my brain around what’s going on.

jellea19:03:36

(defonce data-source (r-native/list-data-source. #js {:rowHasChanged not=}))

(defn list-ui [items]
  (let [data-source (.cloneWithRows data-source (clj->js items))]
    [list-view {:dataSource data-source}]))

jellea19:03:58

this is reagent btw

seantempesta19:03:06

yeah, I’m using reagent now too

seantempesta19:03:07

And in :render-row you’d just (js->clj) the data back?

jellea19:03:18

to make this performant its good to have a container component around it.

jellea19:03:10

:renderRow #(r/as-element [list-item-ui (js->clj % :keywordize-keys true)])

jellea19:03:17

seantempesta: yes

seantempesta19:03:45

okay, so there isn’t a way around converting between clj and js.

jellea19:03:43

Would be interesting to see if a cljs list using the native scroll view would be faster

jellea19:03:55

can imagine those conversions are costly

seantempesta19:03:06

yeah, it just seems…wrong

jellea19:03:25

but currently we're not having problems with them, except for pruning a huge list

jellea19:03:43

(we being Fy)

seantempesta19:03:09

oh yeah, good work btw. I read a bit about your company.

seantempesta19:03:51

Are you using Posh btw? I feel like I read somewhere that you’re using datascript?

jellea19:03:07

seantempesta: No we made our own reconciler which ties datascript in with datomic more directly. But that gave us perf problems, so we removed all of it and the app which went into review today is completely without datascript.

jellea19:03:59

Pretty excited about this release. Bringing startup time down from 8 to 3 seconds

jellea19:03:09

and everything in app is so much snappier

seantempesta19:03:26

All because of datascript? Hmm, I wonder if I shouldn’t continue down this road.

jellea19:03:43

No also other things. Simplifying is key on mobile

jellea19:03:10

We simply had too much dependencies and systems

seantempesta19:03:58

yeah, I hear ya.

seantempesta19:03:13

anyway, thanks for the tips!

jellea19:03:43

seantempesta: youre welcome! what are you building?

seantempesta19:03:34

It’s an app to help non-profit organizations and schools manage their members (aka kids).

seantempesta20:03:30

So I figured it’d just send all the data to the app and do local queries to view the data and only send the changes back to the server.

jellea20:03:24

seantempesta: should be ok if data is small

seantempesta20:03:59

Yeah…I think I need to do some perf testing. I worry what will happen when I try to put 10k entities into the db. Some of the larger orgs I want to serve have that many members.

jellea20:03:02

seantempesta: 10k is too big I'm afraid. We have less entities I think...

seantempesta20:03:51

@jellea: good to know. I’ll look into it.

michaelr22:03:54

getting this error from re-natal deps

michaelr22:03:22

anyone has an idea?

michaelr23:03:04

threeve: thanks simple_smile