Fork me on GitHub
#cljsrn
<
2016-06-15
>
rastandy06:06:53

hi @vikeri, how you adapt font size and other properties based on screen size?

rastandy06:06:58

I’m pretty much interested

rastandy06:06:52

@vikeri: also, how do you updated re-natal to [email protected]

rastandy06:06:06

I’m the only one encountering problems? 🙂

savelichalex06:06:58

@rastandy: We recently talked about it. You need upgrade re-natal (this is only update re-natal) and then update react-native, see https://facebook.github.io/react-native/docs/upgrading.html

savelichalex06:06:10

I remember that read about «em» in RN

vikeri06:06:57

@rastandy: well RN exposes a Dimensions object. With that you can get the screen width and height. And with that you have a dynamic font size based on the screen size. Eg. Over 400px wide gives a base font size of 16 and below you have 14 or something.

savelichalex06:06:36

@vikeri: You need also PixerRatio

rastandy06:06:45

@vikeri: I didn’t know, great!

rastandy06:06:41

@vikeri, thank you very much, I’ll check it out

savelichalex07:06:12

I think that if calculate font-size based on Dimension and PixelRatio we get smth like «em» in web)

rastandy07:06:39

I need to check this out, I’m a newbie on RN

rastandy07:06:51

any suggestion on how to upgrade my re-natal om-next project to RN 0.27?

rastandy07:06:04

I’m getting some strange EOF errors when fetching data from the web

rastandy07:06:13

maybe some RN bug

rastandy07:06:36

Got JS Exception: SyntaxError: Unexpected EOF 06-15 03:50:11.547 1628 1714 E unknown:React: Exception in native call from JS 06-15 03:50:11.547 1628 1714 E unknown:React: java.lang.RuntimeException: SyntaxError: Unexpected EOF (<unknown file>:1) 06-15 03:50:11.547 1628 1714 E unknown:React: at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 06-15 03:50:11.547 1628 1714 E unknown:React: at android.os.Handler.handleCallback(Handler.java:739) 06-15 03:50:11.547 1628 1714 E unknown:React: at android.os.Handler.dispatchMessage(Handler.java:95) 06-15 03:50:11.547 1628 1714 E unknown:React: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) 06-15 03:50:11.547 1628 1714 E unknown:React: at android.os.Looper.loop(Looper.java:148) 06-15 03:50:11.547 1628 1714 E unknown:React: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:187) 06-15 03:50:11.547 1628 1714 E unknown:React: at java.lang.Thread.run(Thread.java:818) 06-15 03:50:11.550 1628 1714 I ReactNativeJS: ERROR FETCHING FEED: [:feeds/feed-by-url http://www.cmcc.it/events?feed=events] 06-15 03:50:11.556 1628 1714 E ReactNativeJNI: Got JS Exception: SyntaxError: Unexpected EOF 06-15 03:50:11.557 1628 1714 E unknown:React: Exception in native call from JS 06-15 03:50:11.557 1628 1714 E unknown:React: java.lang.RuntimeException: SyntaxError: Unexpected EOF (<unknown file>:1) 06-15 03:50:11.557 1628 1714 E unknown:React: at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 06-15 03:50:11.557 1628 1714 E unknown:React: at android.os.Handler.handleCallback(Handler.java:739) 06-15 03:50:11.557 1628 1714 E unknown:React: at android.os.Handler.dispatchMessage(Handler.java:95) 06-15 03:50:11.557 1628 1714 E unknown:React: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) 06-15 03:50:11.557 1628 1714 E unknown:React: at android.os.Looper.loop(Looper.java:148) 06-15 03:50:11.557 1628 1714 E unknown:React: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:187) 06-15 03:50:11.557 1628 1714 E unknown:React: at java.lang.Thread.run(Thread.java:818)

rastandy07:06:43

to much text here

savelichalex08:06:27

@rastandy: oh my) ok, smth wrong with js. Are you sure that all fine with your code? Are you try to remove node_modules and install them again?

rastandy08:06:09

@savelichalex: I’m pretty sure my code works because it happens with some feeds (i’m downloading xml feed data) and not others

rastandy08:06:47

I’ve seen that issue on github

rastandy08:06:55

I think that’s my problem

savelichalex08:06:19

@rastandy: I had some problems with fetch on android, but after upgrade to 0.27 this problems were solved for me

pesterhazy08:06:24

@savelichalex: oh yeah? fetch problems are fixed?

savelichalex08:06:55

@pesterhazy: Looks like yes) On 0.25 I have an error with isomorphic-fetch, but after upgrade to 0.27 all works fine

rastandy09:06:18

@savelichalex: thanks! That’s what I hoped and why I would like to upgrade

rastandy09:06:39

but had problems with the re-natal upgrade

rastandy09:06:51

I need to sort it out

pesterhazy09:06:24

@savelichalex: cool. what's isomorphic-fetch?

savelichalex09:06:29

@rastandy: ok, step by step what i’m do: 1. re-natal upgrade 2. npm i [email protected] —save 3. react-native upgrade (this is can overwrite some your files, make backup before do it, if you change some, for ie build.gradle) 4. check dependensies in package.json (i have [email protected] and [email protected]) 5. maybe you need to drop node_modules and do npm i if you have any trouble that’s all

savelichalex09:06:43

@pesterhazy: looks like that everybody using this for fetch) there is simple library that return node-fetch for node, whatwg-fetch for web and so on, but looks like this library doesn’t maintained anymore and have bugs. I thought that in 0.27 they drop isomorphic-fetch as dependency

pesterhazy09:06:20

@savelichalex: thanks for the explanation

savelichalex09:06:07

@pesterhazy: big problem for js community is low quality packages) that’s why i love clojure)

rastandy09:06:03

@savelichalex: thanks for describing your steps

rastandy09:06:29

@savelichalex: I did pretty the same but with react-native 0.27.0. Need to try 0.27.2

rastandy09:06:06

I had some errors in the figwheel bridge javascript file

rastandy09:06:33

I’ll give it a try again and report errors if I’ll encounter them

rastandy09:06:42

@savelichalex: many thanks again for your help

rastandy10:06:20

may I paste errors I’ve found after upgrading my om-next app?

rastandy10:06:33

it’s not too much text

savelichalex10:06:48

@rastandy: just paste it on snippet)

rastandy10:06:10

is snippet a slack channel?

savelichalex10:06:33

↙️ create snippet

rastandy10:06:08

ok, need to find it 😄

rastandy10:06:35

found it 😄

rastandy10:06:43

don’t know in which file I should look at

rastandy10:06:22

directly into the packager bundle?

savelichalex10:06:59

totally worthless stack traces 😄

savelichalex10:06:21

Not sure that in bundle

rastandy10:06:40

I’m lost. Now I’m trying to build it thorugh lein prod-build

rastandy10:06:15

because maybe the problem is in figwheel-bridge.js

savelichalex10:06:03

Nice idea, I’m always trying lein prod-build because there is a way to get all compile time errors 😉

rastandy11:06:10

it’s a problem in defui from om-next

rastandy11:06:25

clim_earth.android.core.Feed.prototype = goog.object.clone(React.Component.prototype);

rastandy11:06:46

not that om-next has a bug

rastandy11:06:08

but React.Component.prototype is null

rastandy11:06:46

oh yeah, solved this problem, but found that a library i’m using is incompatible with okhttp3 library

rastandy11:06:13

also found the same problem in js/fetch

rastandy11:06:19

lucky day 😄

rastandy11:06:58

i.e. my EOF error when fetching xml data from the network is not solved