This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-11
Channels
- # admin-announcements (1)
- # aws (2)
- # beginners (32)
- # boot (147)
- # capetown (1)
- # cider (11)
- # cljs-dev (45)
- # cljsrn (57)
- # clojure (187)
- # clojure-russia (5)
- # clojure-spec (97)
- # clojure-uk (33)
- # clojurescript (33)
- # cloverage (17)
- # clr (4)
- # conf-proposals (93)
- # core-async (6)
- # cursive (9)
- # data-science (1)
- # datomic (24)
- # defnpodcast (1)
- # devcards (3)
- # emacs (3)
- # hoplon (95)
- # jobs (1)
- # off-topic (7)
- # om (97)
- # onyx (32)
- # overtone (1)
- # parinfer (4)
- # pedestal (1)
- # proton (1)
- # protorepl (13)
- # re-frame (4)
- # reagent (10)
- # specter (14)
- # untangled (40)
how do i use re-natal with react-native-sound? i'm in a middle of a hackathon, so i don't have much time to experiment, sry đ
@caio: Have you read https://github.com/drapanjanas/re-natal#using-external-react-native-components?
@artemyarulin: yeah, but idk what's the component :thinking_face:
I donât use re-natal but I guess you can try npm install react-native-sound âsave && re-natal use-component react-native-sound
and then require it as (def rn-sound (js/require âreact-native-soundâ))
oh yeah, if library has some native code (react-native-sound does) then itâs needed
I thought re-natal does exactly that behind use-component command?
oh, actually donât bother to google it, it was merged to react-native already đ
react-native link react-native-sound
- run this in the root of your project
and react-native-sound
uses some object instantiation. idk how i'm supposed to use it after I do re-natal use-component react...
i'd be fine using it as a library, but for using objects from that lib, i have no idea :thinking_face:
what do you mean by objects? objects in JS?
@caio: Read this on js/cljs http://www.spacjer.com/blog/2014/09/12/clojurescript-javascript-interop/
yeah, itâs just js interop, nothing unusual there
hm, ok. thanks @artemyarulin and @vikeri for the help :punch:
good luck with hackathon - cljs +rn brings a lot of fun usually đ
it says Requiring unknown module 'react-native-sound'
trying to call (def rn-sound (js/require "react-native-sound"))ï»żâ
hm, ok. whatĆ the reasoning behind it? it seems too much magic is going on behind re-natal cmds đ
Itâs related to how the RN packager works. It scans your files for require statements. And re-natal
indeed does some magic to comply with that.
the RN packager, unfortunately, is full of magic, both good and bad
someone just told me about this: https://github.com/Trustroots/Trustroots-React-Native
another cljs + react native project
Do we have an index to all the other cljsrn apps around?
@martinklepsch: Sweet!
http://cljsrn.org has a few
that project is super useful, e.g.: https://github.com/Trustroots/Trustroots-React-Native/blob/master/src/trustroots/fetch_helper.cljs
@ilmirajat: Where have you been all this time? Great work!
about react-native-sound: actually, re-natal use...
doesn't work for using it, and I needed to make some changes on the native code. everything is working fine now, thanks for the help đ
@vikeri: Thanks. I'm newbie in clojure and this is my first "real" project with Clojure. (To be honest, one motivator to use ClojureScript in the app, was to become fluent in Clojure.)
@ilmirajat: did you write the trustroots app?
Btw. do any of you have good refence how unit tests code properly in Cljsrn. The best reference I've found, is this https://github.com/futurice/pepperoni-app-kit. It uses Enzyme (https://github.com/airbnb/enzyme) and React-native-mock for mocking hardware. It was pure pain to get unit tests work reasonably well, and I'm not quite satisfied to my solution.
@pesterhazy: Me and Tarmo Aidantaus (bleadof in github). We do it mostly as pair programming and use one evening per week for it.
@ilmirajat: great stuff
Weâve discusses testing theme a bit before here - nothing âproduction readyâ. I guess official RN way would be https://facebook.github.io/jest/blog/2016/07/27/jest-14.html, although now itâs experimental
we've used Kif on iOS, using accessibility hints
to be honest, it was hard to get to work, and too unreliable
we ended up giving up on it, testing manually instead đ
oh yeah, UI testing should be the latest step - itâs too fragile
For me it was easier to get Mocha + Enzyme + React-native-mock to work. Facebook uses Jest, but for me it looked laborious to configure and there was no good and clear examples...
yep, documentation either sucks or doesnât exists
for UI work I'm not convinced unit tests are very helpful
I mean most of the complexity in UIs is in the interconnection of components
and in the interplay with the runtime (browser or RN)
agree
My main priority is to test handlers and subscribtions, and hardware related logic.
I agree it would be nice to have!
UI is too laborious to test. This is non-profit, community project, so I let community to do it.
@pesterhazy: clearing packager cache did the trick. Maybe add to your blog post âtroubleshootingâ section?
@pesterhazy hm, maybe not strict unit tests, but having tests that test the interaction between components?