Fork me on GitHub

Is there a good guide to using npm included libraries (e.g., npm i LIBNAME --save) -- the part where we fix up add dependencies. Do we first just follow the npm library doc to add to setting and build gradle files? What do we do for project.clj or our cljs files etc? Is there a guide for this part?


And I need this for android primarily...


@doglooksgood, I'd be happy to merge a PR!


@doglooksgood how do you make a release? Is there something about SimpleExampleApp that would need to be changed?


I hope i can send a PR, but i have no experience. i've asked this question before and @vikeri gives me the answer.


I just forgot to write down on my note, so I missed it 😢


What tools are you using for profiling the performance of your react native apps?


@doglooksgood We have a couple of issues that we are working on. Will probably submit a PR to brn when we have figured it out. These issues do not prevent us from releasing but it is flawed: 1. document is not being found if we just do a normal :advanced compilation without the rn/after-cljsbuild task. 2. for the rn/after-cljsbuild task to work one needs to add the reload task before cljs build, even in production. Solution: Decouple the reload part from rn/after-cljsbuild. We use fastlane for the actual building of the Android app and it works great. Are there a certain step that you are curious about?


i'm not sure, but what is the problem if we simply compile cljs with :advanced without introduce any boot task?


The variable document is not found (since it is React Native). There is a brn task that shims this.


Oh, got it. It's very strange that re-natal just use lein cljsbuild once min, generate one file(


IMO, the boot-cljs should do the same work as lein-cljsbuild?


@vikeri not sure that after-cljsbuild should even be needed


have you looked at the bundle task?


this is all I use for iOS:

(deftask dist
  "Build a distributable bundle of the app"
   (cljs :compiler-options (merge default-compiler-options {:optimizations :simple
                                                            :closure-defines {'goog.DEBUG false}
                                                            :elide-asserts true
                                                            :preamble ["preamble.js"]}))
   (bundle :files {"main.js" "main.jsbundle"})
   (target :dir ["app/dist"])))


(note we don't use advanced optimization for prod builds, it doesn't seem worth the trouble right now)


@pesterhazy Nope I have not, don’t know how to include a main.jsbundle for Android though, they fire up a gradle script doing the npm bundle automatically.


sounds like you need to dig into gradle :shudder:


Haha I have done it partly but digging deeper will not be awesome.


Sidenote: If you can get a proper main.jsbundle, why to we need the react native packager? Couldn’t that bundle just be served to localhost:8081?


the problem is that it takes minutes to build this bundle


not acceptable for interactive use


Hey! Were you able to use with re-natal? I’m struggling to find issue in my handler:

(reg-event-fx      ;; <-- note the `-fx` extension
 :request-it       ;; <-- the event id
 (fn                ;; <-- the handler function
   [{db :db} _]    ;; <-- 1st argument is coeffect, from which we extract db 

   ;; we return a map of (side) effects
    :http-xhrio {:method          :get
                 :uri             ""
                 :on-success      [:process-response]
                 :on-failure      [:bad-response]}
    :db  (assoc db :loading? true)}))
I get a cryptic exception that says “Invalid -> new -> … -> day8$re-frame$http_fx$http_effect ...”. BTW: this is an example available here:


Just for reference, I missed: :response-format (ajax/json-response-format {:keywords? true}) and that seems to fix the problem, for details see here:


Apparently adding into ../images is insuffienct if you js/require it, even after restarting my package manager. Is there some other trick to get new resources picked up and added to the package?


.. relative to what?