Fork me on GitHub

@alwx: Nice! Thanks for sharing.


@donmullen: Updated the site!


Automated with Planck 😎


cljs for the win


Do all om-next ui components have to be declared in the same namespace? I’ve been trying to move components to separate namespaces and they just produce errors. Maybe because in the other namepace I require om-next and that’s overwriting something?


@seantempesta: No, you dont need to declare all components in the same namespace.


I’m just starting to use Natal, Om.Next for first test app. I want to use Firebase. How do I include Firebase dependency? Should I install it using npm install firebase —save or should I add it to the project.clj like [cljsjs/firebase "2.2.3-0”]? Any quick tips?


@podviaznikov: Hm, firebase is a remote storage isn’t it? So basically you can try then to use cljsjs/firebase. It will make XMLHttpRequest which is fully available on RN environments


Even you can do npm install for RN, not all of the libraries can be installed - it’s not a NodeJS environment at the end after all


@alwx: Thanks a lot for this awesome example app!!!


Hm, it’s interesting. I think I have everything setup, but I cannot read or write so far from/to Firebase. And I see no errors so far in a repl. So it’s hard to figure out what I did wrong


Try to debug in Chrome and check all the network requests


if there is any


offtopic: Just wow, didn’t know about that. Basically in case there is a need to write a native plugin for RN - we can still use Clojure, omg 😄


@drapanjanas: @donmullen: You're welcome. Hope it will help people to start writing mobile applications in cljs


any idea what the reason might be?


@podviaznikov: the library you are using probably does something with the document


and that, well, doesn’t exist in react native


if it’s just saving variables into the document and doesn’t do DOM actions, you could fake it by manually setting js/document before initialising firebase but not sure that will work


alternatively, I am sure there are firebase clients for clojurescript out there


@dvcrn: thanks. I tried yesterday also without luck of reading/writing to firebase. I used this library both from Clojure(server-side) and ClojureScript(frontend) before. But I’m having trouble making it work with React native


Yeah, it seems like firebase should just work out of the box. That is why I assume I’m doing something completely stupid. But I can’t figure out what


using latest version? 😛


how are you pulling it in? are you using the commonjs require() call?


(def fb (js/require “firebase”))


imports from project.clj

[cljsjs/firebase "2.2.3-0"]
                 [matchbox "0.0.8-SNAPSHOT”]


my requires

(:require [ :as om :refer-macros [defui]]
            [cljsjs.firebase :as firebase]
            [matchbox.core :as m])


(set! js/React (js/require "react-native/Libraries/react-native/react-native.js”))
(def firebase-ref (js/Firebase. "”))


(def firebase-ref (js/Firebase. "))
then why are you using it through js/Firebase? couldn’t you just use the imported firebase?


(just guessing. I never used firebase)


re-natal use-component firebase


yeah if you use the node module you have to fix the packager with that


but I thought you use the cljsjs version


with that it shouldn’t be necessary


no, I tried 1)

(def fb (js/require "firebase”))
2) I tried cljsjs version and I tried 3) matchbox which is wrapper. All 3 times I had no success


all 3 are giving you the same document error?


Current version of firebase in npm is 2.4.0 while cljsjs version is 2.3.1 maybe older version does not work with react native? So probably you have to use latest npm version. But not sure how to properly require that in natal


@seantempesta: What are you using? natal/renatal, reagent?


re-natal + om-next


Hm, React ref initialised here, not sure that you can affect it spoil it from the code anyhow


make sure that you have latest om, just in case


no, I’m wrong, you can use :ref in many cases actually


I posted the following to the cljs mailing list but then realized I should have inquired here first... any thoughts? I'm prototyping a native version of an existing webapp that uses a Canvas element to display video (raw RGBA frames @ ~20fps) obtained via a websocket. The native version is built using re-natal (kudos!) and I'm able to connect to the websocket and obtain the ArrayBuffer. So far so good... unfortunately, the RN Image component only provides a source/URL property for the image source that it will use to download/decode images. But I already have the data. Of course I could transform my image data to a base64 encoding and use a data url but, eeewww. I just need a surface I can draw the raw image data onto. How hard can that be? Does anyone have an alternate suggestion for displaying a series of images quickly and efficiently. I'm looking over some of the RN opengl components - does anyone have experience using any of them? Suggested libraries? Flipboard has some components that look ok... I'm still evaluating them. Is there another RN component I'm overlooking? A different technique altogether? My next step is to create my own RN component to do this. I was just hoping to avoid that by using existing libraries/components.


@kahunamoore: There is a thing called arc, don’t know where the docs, but here example usage from the issue


not sure that it can be used for video, but I guess this is a canvas alternative


not sure that I follow, can you show.. am, video?


I’ve seen a demo by David Nolen himself using Ejecta w/ Ambly:;;t=35m30s


Not sure if that’s the integration you’re looking for, but looks very promising


Cool - thanks! I'll take a look. I remember him mentioning RN and opengl/cljs working prototype in one of his talks but was unable to find the reference.


Just to clarify the use case. The websocket is sending video frames (raw RGBA data) one after the other and the original webapp displays each frame on a canvas one after the other as fast as they come in. Just trying to do the same thing with RN/cljs


Sounds weird, I know. The source is an embedded system that doesn't have the CPU to encode the video and use normal video protocols... this was a hack that worked for our limited use.


Sounds interesting. I definitely don’t have the immediate knowledge on how to draw raw RGBa data to a canvas using opengl in CLJS, but it seems possible


In the browser based webapp it boils down to ctx.putImageData(clampedArrayView,0,0); where ctx is the canvas drawing context.


Thanks for the link!


Hey guys. I know, if you use Frappe to shake Android devices, you may be tired of clicking "Reload JS" or "Debug JS" using React Native context menu. I've forked Frappe and solved this problem. It is much easier to reload JS or start debugging now.


@alwx thanks for sharing. I've been looking around for more examples. sadly I can't get this working in xcode simulator ... luno-react-native/ios/luno.xcodeproj Applications using launch screen files and targeting iOS 7.1 and earlier need to also include a launch image in an asset catalog. in case you have any idea how to fix that please inform.


@jurgen_photek: I guess if you have just checked out the repo you need to run npm install first to download all deps


thanks, I gave that a go but getting an error on running.... but poking about I realise I have problems that are not specific to this luno proj. re-natal init Mynextproj creates a new project and looks to be fine. then open it in xcode, then running, I get

2016-01-26 22:52:20.026 [error][tid:main] {"type":"InternalError","message":"react-packager has encountered an internal error, please check your terminal error output for more details"}
now i installed re-natal for the first time a few days ago and created and ran a new project in xcode fine.... I guess I upgraded it since then so perhaps a new version has caused me problems. I'll try downgrading and see if that works


You can try avoiding re-natal stuff, by doing lein prod-build this will compile ‘fat’ index.ios.js and which you should be able to just run


but for developing luno with figwheel try using [email protected].


One more thing you have to do to make it run now is in registerRunnable call you need to change “Luno” to “luno”. Author knows about this so it will be fixed soon.


At least I had to do it to make it run and it did simple_smile


ok I'll try that. just to be sure i just created a brand new project via re-natal init, did lein prod-build, which worked, then running in xcode get the same react packager error as above.. re-natal is version 0.2.19. I'll try other versions and if I find anything helpful I'll let you know. despite this... great effort on re-natal. looking fwd to developing with it. gotta get some sleep now


re: Frappe, as an alternative you could just bind something to execute the shell command adb shell input keyevent 82