Fork me on GitHub
#cljsrn
<
2016-11-02
>
seantempesta01:11:06

@tiensonqin: Does exponent-cljs have the same problems where the React Native packager hits out of memory errors (I think related to parsing the final cljs output files looking for require dependencies)?

tiensonqin02:11:32

@seantempesta Don’t have this out of memory errors recently, since I switched to advanced mode.

artemyarulin08:11:40

Does anyone know what causes that in Emacs/Cider: If I eval (.createElement react "Text" nil "Hello”) then I got errors in repl like:

#object[TypeError TypeError: Cannot convert a symbol to a string]
join@[native code]
cljs$core$IFn$_invoke$arity$1
cljs$core$str
cljs$core$pr_writer_impl
cljs$core$pr_writer

cljs$core$pr_sequential_writer
cljs$core$print_map
cljs$core$pr_writer_impl
cljs$core$pr_writer
cljs$core$pr_seq_writer
cljs$core$pr_sb_with_opts
cljs$core$pr_str_with_opts
cljs$core$IFn$_invoke$arity$variadic
cljs$core$pr_str

eval code
eval@[native code]
figwheel$client$utils$eval_helper
Although if I eval (str (.createElement react "Text" nil "Hello”)) then everything works just fine

pawel.kapala12:11:23

Hey. Have anyone tried to integrate react-native-modal-picker with re-natal? I’ve installed the lib with npm, and configured figwheel to pick it up, but I’m stuck require’ing it. This doesn't look right, does it (as it yields object, and it should be number or string for hiccup to pick it up)? (def modal-picker (r/adapt-react-class (js/require “react-native-modal-picker”))

sineer15:11:47

@pawel.kapala look at your .re-natal for the modules key. ex: "modules": [ "@exponent/ex-navigation" ],

pawel.kapala15:11:05

@siner I think I got it

sineer15:11:11

man re-natal for link and install commands

pawel.kapala15:11:20

I had it in my .`re-natal` file properly

pawel.kapala15:11:44

the issue was with ES6 export default class

pawel.kapala15:11:56

so instead of (def modal-picker (r/adapt-react-class (js/require “react-native-modal-picker”)) I used: (def modal-picker (r/adapt-react-class (aget (js/require “react-native-modal-picker”) “default”)))

pawel.kapala15:11:02

Not sure if this is the proper way of requiring this module, but it surely worked for me

sineer16:11:10

oh yeah that one got me too earlier. I use this: (defonce NavigationProvider (.-default (js/require "@exponent/ex-navigation/src/ExNavigationProvider.js")))

sineer16:11:54

I think you'll run into issue with your aget way to do it when you run optimizations because of the "default" name being shorten and such..

pawel.kapala16:11:51

@sineer Thanks a lot! You probably saved me a day of debugging after optimizations: I’ll change that right away.

pawel.kapala16:11:24

Yeah, that’s perfect

sineer16:11:41

I myself am still somewhat confused by that when doing interop with js is very confusing... read last section of that article a few times 😉