Clojurians
#cljsrn
<
2016-01-11
>

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

wei02:01:12

is there a good swiper component available? if not, was thinking of writing one

mfikes02:01:05

(I can’t speak to its quality or feature set, but it worked fine for me.)

dvcrn06:01:25

@drapanjanas: are you using reagent as well?

dvcrn06:01:54

I tried something like this now:

(map #(-> %
                  (assoc :animateDrop true)
                  (assoc :rightCalloutView [view {:flex 1} [text {} "Hi"]])) data)))))
(react native mapview annotatiosn) but it just ends up not rendering the [view] stuff

dvcrn06:01:30

ah maybe I phrased my question wrong

dvcrn06:01:48

inside the normal react tree it renders fine but I need to specifically pass a rendered component as property

dvcrn07:01:29

if anyone has an idea, please ping me :simple_smile: This is blocking me a little bit too much right now

drapanjanas07:01:46

@dvcrn try wrapping that hiccup array using a function as-element from reagent core. I use reagent in my free-time project currently finishing web part, so not working alot on mobile apps yet.

(assoc :rightCalloutView (reagent.core/as-element [view {:flex 1} [text {} "Hi"]]))

artemyarulin07:01:51

@mfikes: I was reading this RN newsletter now and I was like - hm, this project sounds familiar :smile: Nice start of the week

artemyarulin07:01:49

@donmullen: Sorry, didn’t have time to put ideas to the wiki during the weekend, will do it today

artemyarulin10:01:25

btw - I’m creating a new product and frontend part of it would be open sourced from the start: https://github.com/kapteko/frontend. It would include browser/iOS/Android clients plus win/mac versions using Electron framework. Currently almost nothing there (working on Buck as a universal build system for all of the staff currently) but in a feature I hope it may be a useful example of building staff with CLJS + RN + Om-Next

tord11:01:25

I'd really like to use cljsrn for our next mobile app, but unfortunately, since I'm the only Clojurian here, using ClojureScript for the entire app is out of the question. Is it possible to use cljsrn only for certain views, in an app that is otherwise written using Apple's and Google's development tools? If not, is it possible to use ClojureScript in parts of a regular JavaScript React Native app?

artemyarulin12:01:56

It’s not actually about CLJS but here as you can see ReactNative creates just some views that you can integrate in the any place of an app

artemyarulin12:01:23

Another cool example is https://github.com/facebook/react-native/tree/master/Examples/UIExplorer, it shows how to integrate RN views inside the existed app and vice versa - integrating existing native view inside of RN app

artemyarulin12:01:15

But I would recommend it only in case you know mobile development/React Native and ClojureScript really well. Otherwise it could be a tough task to handle, not that many examples yet

tord13:01:52

@artemyarulin: Thanks! I know mobile development and ClojureScript well enough, but I've never even touched React Native. Unfortunately, it sounds like trying to use cljsrn would be too risky for me at the moment.

artemyarulin13:01:28

Well yeah, from the other side I would highly recommend implementing mobile application with React-Native.

artemyarulin13:01:14

Even without ClojureScript - once you tried it, there is no way back. It so dramatically better that native development

artemyarulin13:01:39

and later on you can add parts using cljs

tord13:01:08

Even for apps with lots of graphics and animations?

artemyarulin13:01:37

for anything. Really - if you know mobile development already you know all the pains. Just spend couple of hours with React Native, play with animation get idea of a development workflow (instant refresh omg). Check how easy is to create a native module, how cool the React flow itself.

artemyarulin13:01:41

once again - react native is not all in, you can escape to the native part for the critical parts

tord13:01:38

I'm tempted to try, but what's the safest path? Native app with some parts in RN, or RN app with some native parts?

artemyarulin13:01:34

Well, RN generates native UI at the end

artemyarulin13:01:13

I would start with RN for everything and in some cases (if there is a perf problem, or you want to have 3D or there is an external component already) I would implement RN native module to wrap it or maybe embed the native view inside RN app

artemyarulin13:01:20

are you building both iOS and android?

tord13:01:35

Yes, both.

artemyarulin13:01:59

then there is nothing to discuss :simple_smile:

tord13:01:11

Starting with RN for everything seems tempting, but probably also the most difficult approach to get the rest of the team on board with.

tord13:01:51

Anyway, I'll at least spend a few hours playing around with it on my own next weekend, and see how it works for me. Thanks for all the advice!

gphilipp19:01:46

Hey @artemyarulin, I put up a repo with a Tab Bar integration example. I have an issue with the navigator, I explained everything in the README. Can someone take a look and help me make it work ? https://github.com/gphilipp/cljsrn-tabbar-demo

pesterhazy20:01:28

@mjmeintjes: saw boot-react-native today, looks super interesting

pesterhazy20:01:44

this looks great as well, for starting an app in the simulator without opening XCode: https://github.com/facebook/react-native/pull/5119/files

artemyarulin20:01:41

@pesterhazy I’m now playing (well actually moving all the existing projects) to https://buckbuild.com, which has all of those staff. It support unified way of dealing with actually any projects, but by default it can do: buck build - build the project, iOS, Android. Or any custom using your own scripts buck test - same but for testing buck run - deploy the project to the device/emulator. Internally FB team is using Buck already for RN and they working on releasing it support to the open source in a feature. So if you have to deal with multiple project (iOS/Android/browser/backend/etc) all the time - I highly recommend checking this

pesterhazy20:01:49

@artemyarulin: interesting, will check it out

pesterhazy20:01:51

I'm keen to build iOS cljsrn apps with a simple, reproducible command, ideally without an xcode project

artemyarulin20:01:21

I was building hello world with simple buck build command and it took for me 3 second to build iOS version and 0.8(!) second for the android. My XCode starts like 5 second only :simple_smile:

pesterhazy20:01:19

you got me curious

artemyarulin20:01:29

and after I changed HelloWorld text it took 0.1s to rebuild the project. I was like - RLY?!

artemyarulin20:01:13

you can also check bazel from Google. Both systems share a lot of ideas (and code actually)

artemyarulin20:01:41

I decided to go with Buck, cause Facebook, React, etc.

donmullen21:01:34

@artemyarulin: so you are triggering all cljs builds as well from Buck?

artemyarulin21:01:54

@donmullen: I’m planning yes. You can always wrap anything with genrule and sh_test like here https://github.com/kapteko/frontend/blob/master/blog/BUCK

artemyarulin21:01:32

The cool thing in BUCK that you can do a lot of staff programatically - right now I’m working on a rule for om-next component. So at the end each component folder would contain only one [component-name].cljs (and related styles, localization, etc.) and BUCK build then do all the rest

artemyarulin21:01:13

and by rest I mean building JAR with all deps, building JS files if needed for later references or maybe just composing cljs as a part of other module