Fork me on GitHub
#cljsrn
<
2016-06-03
>
misha06:06:45

@drapanjanas 0.26. and it does not contain SwipeableRow/* in node_modules, yes, but I could not find a way to import any other Experimental components which are present in my project's node_modulel/react-native/Libraries/Experimental. do I need to do something extra? like wrap those in a package myself and then require by path, rather than require by name?

savelichalex06:06:15

@misha: is it in your node_modules try to use it directly in require, just remember that require work from root of your app folder. For example: (js/require «node_modules/react-native/Libraries/Experimental/<smth>»). This work on web apps, not sure this work on react-native

misha06:06:42

@savelichalex: yeah, trying that did not help either

misha06:06:46

(js/console.log (js/require "node_modules/react-native/Libraries/Experimental/Incremental.js"))
(js/console.log (js/require "node_modules/react-native/Libraries/Experimental/Incremental"))
Requiring: node_modules/react-native/Libraries/Experimental/Incremental.js
Requiring unknown module "node_modules/react-native/Libraries/Experimental/Incremental.js".

Requiring: node_modules/react-native/Libraries/Experimental/Incremental
Requiring unknown module "node_modules/react-native/Libraries/Experimental/Incremental".

drapanjanas07:06:08

@misha I was able to require (def IncrementalPresenter (js/require "IncrementalPresenter”))

misha07:06:04

did you do any re-natal use-component on it?

drapanjanas07:06:18

first I tried with lein build-prod it worked

drapanjanas07:06:35

yes, re-natal use-component IncrementalPresenter

drapanjanas07:06:03

you always provide same string to use-component as to require

drapanjanas07:06:29

but for me it did not work with WindowedListView because module nullthrows was not found, not sure why

misha07:06:33

wow it worked. sweet!

misha07:06:05

@drapanjanas: now, how do I update RN in my re-natal project?

misha07:06:33

re-natal upgrade?

savelichalex07:06:43

re-natal upgrade update only re-natal

savelichalex07:06:51

not dependencies

drapanjanas07:06:09

no to upgrade RN you have to do it manually as per RN docs

savelichalex07:06:00

I tried this before and get some strange bugs)

savelichalex07:06:18

conflicts between packages

misha07:06:13

that's the price of the cutting edge tech kappa

drapanjanas07:06:30

well, re-natal does not change* the RN app, so whatever there is in RN will happen 🙂

drapanjanas07:06:29

* with minor exceptions of urls

savelichalex07:06:32

@drapanjanas: correct me if i’m wrong: when you upgrade re-natal app dependencies doesn’t update, but if i’m create new project with upgraded re-natal I get newest version of RN?

misha07:06:41

@drapanjanas: is it safe (from re-natal pov) to update to any RN versions? I am aware I might get some app code broken, but it should not break any re-natal scaffolding, right?

drapanjanas07:06:11

yes, when you upgrade re-natal you get updated scripts like figwheel-bridge.js and whatever changes in .re-natal config, but not more than that

drapanjanas07:06:48

but deps in your package.json stay untouched

savelichalex07:06:49

maybe make cli option for this?

drapanjanas07:06:06

when you init new app with new version of re-natal you get recent version of RN in package.json so newer react-native app is initialized

drapanjanas07:06:57

@savelichalex: there is a CLI for upgrading in react-native

drapanjanas07:06:07

it should work

misha07:06:12

how does RN objective c code get updated?

drapanjanas07:06:01

by react-native upgrade

savelichalex07:06:02

@drapanjanas: but when I’m create project with re-natal I doesn’t install react-naative global, isn’t it?

drapanjanas07:06:54

to create RN app init uses react-native cli, so whatever is there. no global as I know

savelichalex07:06:47

I mean that it’s cool use just re-natal and not use react-native)

savelichalex07:06:49

This is can just line in npm scripts in package.json to run «react-native upgrade», but run it from re-natal is cool IMO

drapanjanas07:06:51

@savelichalex: I have a different opinion, too much sugar gives you diabetes 😄

drapanjanas07:06:31

I mean, less is more, and stuff

savelichalex07:06:51

Maybe you right, but it’s common issue for developers)

savelichalex07:06:43

Anyway need note in readme to re-natal about it)

drapanjanas07:06:23

about upgrading?

savelichalex07:06:07

Just when I’m first time upgrade re-natal from cli, I thought that RN updated too

savelichalex07:06:27

But I was surprised:smile:

drapanjanas07:06:02

yeah… its there at the bottom of Upgrading existing project, but it is invisible prrobably

drapanjanas07:06:51

I will improve that

savelichalex07:06:18

Maybe move it right after header for upgrade

drapanjanas07:06:44

maybe two subchapters would make it more clear: upgrading React Native version and upgrading re-natal CLI

savelichalex07:06:18

oh yeah, sounds great!

drapanjanas07:06:32

will do it this evening

drapanjanas07:06:20

@misha yes you should be able to upgrade RN version any time painlessly by following RN guide.

drapanjanas07:06:38

without upgrading re-natal itself

misha07:06:53

sweet, thanks. my main concern was about obj c code, but apparently RN cli manages that stuff, so I think I'm good.

savelichalex07:06:56

@drapanjanas: another improvement is to write in terminal when you upgrade re-natal, that available new RN version and put link to guide

savelichalex07:06:29

@misha: don’t forget Cmd+k in xcode 😉

misha07:06:43

which is?

savelichalex07:06:16

@misha: this is clear build files

misha07:06:49

I got some dependency exceptions on rn update, so I killed node_modules folder before retrying, and x-code died, so all is good kappa

savelichalex07:06:14

@drapanjanas: I’ll try to do this on weekend and make PR)

savelichalex07:06:59

But I have bad relationship with coffeescript)

misha08:06:29

@savelichalex: "Unable to resolve module emptyFunction" zzz

savelichalex08:06:06

Are you trying to require direct from react-native source?)

misha08:06:51

doing

re-natal use-component SwipeableRow

savelichalex08:06:54

Don’t know why ^^^ this magic works, but maybe trying to do use-component emptyFunction 😕

savelichalex08:06:19

hm, looks like bug in RN) if search in RN repo by emptyFunction then in all places it is 'fbjs/lib/emptyFunction'

savelichalex08:06:49

change it directly in react-native source to 'fbjs/lib/emptyFunction'

savelichalex08:06:59

but of course that not ideal

misha08:06:02

I ended up copying emptyFunction code into SwipeableRow harold enough js for today