Clojurians
#cljsrn
<
2016-04-06
>

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

artemyarulin07:04:08

Cannot find - does stateless functional component work with RN? And can we make it using CLJS? Like from here: https://facebook.github.io/react/blog/2015/10/07/react-v0.14.html#stateless-functional-components

var Aquarium = ({species}) => (
  <Tank>
    {getFish(species)}
  </Tank>
);

artemyarulin07:04:37

Never mind - by default with such functional components shouldComponentUpdate will always return true and we’ll loose the biggest win from immutable data structures.

misha08:04:01

@artemyarulin: have a look at https://github.com/tonsky/rum#mixins rum.core/static

artemyarulin08:04:35

yep, thanks @misha

artemyarulin08:04:58

The more I look into Rum - the more I like it

artemyarulin08:04:11

whole source code is just a 400 lines

misha08:04:24

364 :kappa:

misha08:04:06

btw, cloc treats :clj: docstrings as code too

artemyarulin08:04:48

btw - I’m a bit worried: src folder wasn’t changed during last 5 months. Either project is done or it’s kinda partially abandoned. What do you think?

misha08:04:58

it is not officially RN-ported, and there is nothing new in R afaik, so that'd be my guess of reason

artemyarulin09:04:29

Nice - so it’s complete. Are you considering to officially port it to RN? I know it’s one line change but would be awesome to make a pull request to change it or maybe at least mention it in the README?

misha09:04:05

the only difference I found with rum between R/RN:

[:div [:span "text"]] ;;no props
works, and this does not:
(touchable-highlight (text "text"))
so you need to provide {}:
(touchable-highlight {} (text {} "text"))
which is difference between "raw" RN components use via interop, and sablono's dom; and is not actual rum's issue

misha09:04:31

@artemyarulin: I'm not very profound in neither R nor RN nor rum to conclude that's it is in fact ported : ) so my plan was to actually port a piece of app first, and then spread the word

artemyarulin09:04:32

Nice, I’ll play with this as well

jessica16:04:58

I’m trying to write some tests, but I’ve been hitting some issues when running them. i.e. whenever my source code hits a line that calls (js/require “<some required dep>”), I get thrown an error. I’m just using cljs.test’s deftest, is, and run-tests. Listed below some of the other errors I’m seeing as well. Any suggestions? when referencing js/DEV__

ReferenceError: __DEV__ is not defined
when trying to require (js/require "react-native")
SyntaxError: Unexpected token …
when including dependency ajax.core
ajax/xml_http_request.cljs:11
(extend-type js/XMLHttpRequest
^
ReferenceError: XMLHttpRequest is not defined
at Object.<anonymous> (<my-dev-directory>/target/ajax/xml_http_request.cljs:11:1)

artemyarulin18:04:58

@jessica: I guess you can try release build - it should generate bundle with all JS embeded

jessica20:04:17

Thank @artemyarulin ! just to clarify, do you mean running lein prod-build? I'll try that out later today and let you know how it goes!