Fork me on GitHub
#cljsrn
<
2016-05-28
>
marc-schwartz03:05:16

There has been some interesting discussion about re-natal, react-native-boot, etc... Is anyone else thinking about eschewing babel and the react-native packager all together and writing a custom cljs packager for RN in clojure?

tiensonqin10:05:36

link is fine, and both figwheel, react-native don't complain

pesterhazy11:05:56

@tiensonqin: we're using the fbsdk successfully (with 0.19)

tiensonqin11:05:42

I'm using 0.2.1

pesterhazy11:05:54

although we're seeing intermittent issues with it

pesterhazy11:05:53

@marc-schwartz: sounds interesting. What are you thinking of exactly?

pesterhazy11:05:24

I'm actually fighting with the react native packager myself, it's a strange (and largely undocumented) beast.

tiensonqin11:05:27

such complex, every corner is a trap

pesterhazy11:05:04

fbsdk for sign in is terribly complex, I couldn't agree more

tiensonqin11:05:13

but it works, so I'd move on with this

pesterhazy11:05:40

hehe that's my attitude as well

pesterhazy11:05:48

how's 0.26.2 for you?

pesterhazy11:05:28

I'm struggling big time trying to update boot-react-native to that version: https://github.com/mjmeintjes/boot-react-native/issues/49

marc-schwartz14:05:24

@pesterhazy: just thinking that in dev-mode, the packaging server provides source files through http endpoints and code changes are published though a web socket. That is all our react native apps see... It should be possible to build source in memory with the Google Closure compiler and provide the compiled source to RN apps by providing the same api as the package server.

pesterhazy14:05:04

Interesting idea. I suspect that the packager needs to be involved anyway, because that's all the RN developers test with

pesterhazy14:05:43

But maybe you can do that in a single step, with one offline bundle that gets augmented by the cljs code?

pesterhazy14:05:11

I guess that's roughly how re-natal works

debug18:05:45

"ReactNativeJS: {:status 0, :status-text "Request failed.", :failure :failed}" is being thrown on a ajax.core's GET call, why?

debug18:05:12

(register-handler
  :load-data
  (fn [db _]
    (GET ""
     {:handler #(dispatch :process-data %1)
      :error-handler #(.warn js/console (str %))})))

(register-handler
  :process-data
  (fn [db value]
    (assoc db :data (str value))
    (.warn js/console (str value))))

debug18:05:36

These are the handlers, the :error-handler gets invoked

debug18:05:17

Any additional setup required for network calls on a "re-natal" project?

savelichalex18:05:38

@debug: nope, no additional setup needed

pesterhazy22:05:35

@debug, cljs-ajax works great for me on boot-react-native