Clojurians
#cljsrn
<
2015-12-09
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

johannjohann01:12:04

poking around in the debugger

adamfrey01:12:58

I don’t know a ton about this, but I think this commit to React Native opens up better packaging possibilities for us in the future: https://github.com/facebook/react-native/commit/8d397b4cbc05ad801cfafb421cee39bcfe89711d

mfikes01:12:34

I was just reading the same :)

johannjohann02:12:34

hey guys, when im running set-query! my view gets rerendered with the entire datascript db passed in as a root prop

johannjohann02:12:53

ive been poking around and am wondering if the root component is expected to look like this? https://www.dropbox.com/s/8hp3asuepv5zi19/Screenshot%202015-12-08%2018.37.25.png?dl=0

johannjohann06:12:47

here's the fix i have arrived at the for aforementioned problem. ive included some gifs https://gist.github.com/jobez/9ea1963b2b07454a28a6

johannjohann06:12:42

includes a reproduction case and a different reconciler implemention that seems to fix the issue

artemyarulin13:12:06

Playing with Om-Next for iOS. Obviously compilation fails if I have a require of om.dom as there is no React.Dom. I like the idea of cross platform components (browsers and mobile) and I wonder what could be the best way to achieve that? Technically I can create wrapper around all the React components and use it, but hm, there are no span or div in RN

artemyarulin13:12:28

Have anybody though about it? It looks kinda possible… I guess

artemyarulin13:12:36

Oh, for om-next render is just a function. I can put in a different file with different imports. So I would achieve component logic/query/mutation reuse and at the same time have two different renders for different platforms

artemyarulin13:12:12

oh, it’s vice versa - nice :simple_smile:

artemyarulin13:12:40

But in any case I like idea of two different renders - likely that mobile and web version would be different

artemyarulin14:12:17

oh not, hm. I have to think about… thanks, I’ll think about this project

artemyarulin14:12:49

Hm, can anybody explain om-next initialisation for RN. At the end of mfikes example:

(om/add-root! reconciler AutoCompleter 1)

(defn ^:export init []
  ((fn render []
     (.requestAnimationFrame js/window render))))

mfikes14:12:05

That bit is no longer needed.

mfikes14:12:27

I suppose I need to update the page. It has been removed from Natal.

artemyarulin14:12:47

OK, good. But (om/add-root! accept DOM element as a last argument

mfikes14:12:57

The purpose of it is that changes to the app state previously would not cause an automatic re-render. You’d have to click in the UI.

mfikes14:12:15

Oh… I thought you were referring to the requestAnimationFrame business.

artemyarulin14:12:30

well thanks for explaining this one as well

artemyarulin14:12:50

But as this render is no needed why you have 1 as a last param?

artemyarulin14:12:56

ahhh, it doesn’t matter I guess? RN will find your root component from the AppDelegate

mfikes14:12:58

I can only speak to the Om now approach which has (om/root widget app-state {:target 1})

anmonteiro14:12:15

@artemyarulin: React needs to mount on a given element

anmonteiro14:12:21

since there is no DOM in RN

anmonteiro14:12:32

1 is the top-level view

mfikes14:12:49

React Native previously only wanted the number to be congruent to 1 mod 10.

mfikes14:12:02

Perhaps 1 now has meaning?

artemyarulin14:12:28

@anmonteiro: Oh, I din’t know about those number, makes sense now, thank you!

anmonteiro14:12:57

at least this is what I've gathered

anmonteiro14:12:06

I haven't tried with a number other than 1

mfikes14:12:24

FWIW, I never developed an understanding of it. Once it worked for me, I stopped digging :simple_smile:

artemyarulin14:12:11

I guess it’s OK for me, too lazy to dig as well :simple_smile:

mfikes14:12:21

Life is short

mfikes14:12:39

It would be nice to know and understand, but...

johannjohann19:12:37

really stoked on that figwheel setup