Clojurians
#cljsrn
<
2015-11-25
>

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

gphilipp11:11:46

Installing Xcode 7 did the trick. Now i’m bitten by https://github.com/dmotz/natal/issues/33

gphilipp11:11:58

Upgrading watchman to 4.1 resolved this issue.

gphilipp12:11:36

Has anyone tried to embed static images (think logo for example) within the app ? Apparently, it’s [possible with React Native](http://stackoverflow.com/questions/29308937/trouble-requiring-image-module-in-react-native/29310672#29310672). What would be the equivalent using Ambly / Natal ?

mfikes14:11:10

Yeah, I got it to work.

mfikes14:11:16

I followed the instructions on how to put it into index.ios.js, (so it briefly shows the image there). Then I included it in the ClojureScript.

mfikes14:11:34

(image {:source (js/require "TestImage/gilles.png")})

mfikes14:11:21

My project name is TestImage, so I used the “cheat” technique described in http://blog.fikesfarm.com/posts/2015-07-24-using-react-native-components-in-clojurescript.html to see what React was doing.

mfikes14:11:36

That’s how I found that I needed to put the project name in the string.

mfikes14:11:54

It works, but clearly that process can be improved.

mfikes14:11:31

@gphilipp ^

mfikes14:11:32

So, in my bundle, I saw React.createElement(Image,{source:require('TestImage/gilles.png')})

mfikes14:11:42

And to get that appear, I had added this to my index.ios.js: <Image source={require('./gilles.png')}/> along with adding Image to the list of stuff in the var list at the top.

mfikes14:11:15

And, I also put a gilles.png file adjacent to my index.ios.js file.

mfikes14:11:41

Of course, the next question is: “How do you accomplish this without it being in index.ios.js”? The same unanswered question is in my blog post, essentially.

gphilipp17:11:50

awesome (not the pic,huh) :simple_smile:

felipebueno17:11:33

hello everyone! I'm developing an app in React Native with JSX and now it needs to communicate with a lib written in ClojureScript. Has anyone here ever done anything like this? Any ideas on how I could accomplish this?

mfikes18:11:09

@felipebueno: you could "layer" the ClojureScript runtime and the lib after React Native. Then you could call from JavaScript into ClojureScript. In ClojureScript you'd want to expose things via very simple interfaces that internally employ js->clj and clj->js as needed.

mfikes18:11:29

Take a look at how Natal / Ambly do the “layering.” In your case you are really just calling in the opposite direction.

felipebueno18:11:58

Thanks, @mfikes :simple_smile:

mfikes18:11:39

(I've done a decent amount of calling ClojureScript from Objective C, and JavaScript is “closer” to ClojureScript than Objective C, so I'm sure it works. If you end up using :advanced that can work as well; just need to use ^:extern on the functions you export to JavaScript.) @felipebueno