This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-13
Channels
- # beginners (14)
- # boot (108)
- # carry (6)
- # cider (28)
- # cljs-dev (107)
- # cljsrn (32)
- # clojars (4)
- # clojure (62)
- # clojure-austin (15)
- # clojure-berlin (1)
- # clojure-brasil (3)
- # clojure-chicago (1)
- # clojure-dev (9)
- # clojure-greece (2)
- # clojure-italy (4)
- # clojure-nl (1)
- # clojure-poland (2)
- # clojure-portugal (1)
- # clojure-russia (24)
- # clojure-spec (63)
- # clojure-uk (30)
- # clojurescript (123)
- # cursive (13)
- # data-science (1)
- # datascript (1)
- # datomic (27)
- # devcards (11)
- # dirac (1)
- # emacs (5)
- # events (4)
- # hoplon (27)
- # jobs (3)
- # juxt (3)
- # leiningen (11)
- # off-topic (18)
- # om (46)
- # om-next (7)
- # onyx (50)
- # pedestal (6)
- # portland-or (8)
- # proton (16)
- # re-frame (38)
- # reagent (21)
- # ring-swagger (14)
- # specter (46)
- # untangled (116)
- # vim (46)
- # yada (22)
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?
Looks like this is at least a start: http://blog.fikesfarm.com/posts/2015-07-24-using-react-native-components-in-clojurescript.html
@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.
@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(index.android.js).
@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"
[]
(comp
(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:
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 day8.re-frame.http-fx 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 "https://jsonplaceholder.typicode.com/posts/1"
: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: https://github.com/Day8/re-frame/blob/master/docs/Talking-To-Servers.md#version-2Just for reference, I missed:
:response-format (ajax/json-response-format {:keywords? true})
and that seems to fix the problem, for details see here:
https://github.com/Day8/re-frame-http-fx#step-2-registration-and-use
and itās merged š https://github.com/Day8/re-frame/pull/251