This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-20
Channels
- # aatree (42)
- # admin-announcements (25)
- # alda (28)
- # aws (56)
- # beginners (67)
- # boot (248)
- # braid-chat (9)
- # cider (52)
- # cljsrn (11)
- # clojars (4)
- # clojure (341)
- # clojure-czech (5)
- # clojure-japan (3)
- # clojure-nl (2)
- # clojure-russia (57)
- # clojured (10)
- # clojurescript (35)
- # community-development (18)
- # cursive (17)
- # datascript (5)
- # datomic (39)
- # dirac (25)
- # editors (2)
- # events (3)
- # hoplon (60)
- # jobs (5)
- # ldnclj (9)
- # leiningen (5)
- # mount (20)
- # off-topic (3)
- # om (263)
- # onyx (69)
- # perun (5)
- # proton (55)
- # re-frame (7)
- # reagent (24)
- # spacemacs (6)
- # yada (16)
I'm very new to cljs and now studying modern clojurescript tutorial at github. My goal is to create website with golang backend and cljs frontend At now I'm stuck with boot-reload task. Problem is that cljs task has compiler option :asset-path "/js/main.out" and it's working fine: js paths is http://host:port/js/main.out/some.js. But when boot-reload tries to reload my web page, it trying to load js files from http://host:port/main.out/... I did some googling and nothing helped me. Boot reload task also has option :asset-path but it working in different way as I understood. Any suggestions? Accept of using lein
Hi @nayzak, welcome! You could check out the saapas sample project: https://github.com/Deraen/saapas/blob/master/build.boot. There you'll see in the build.boot that it uses :ids #{"js/main"}
for both cljs and reload tasks.
Then it has a js/main.cljs.edn
file in https://github.com/Deraen/saapas/blob/master/src/cljs/js/main.cljs.edn where it specifies the init-fns which will be called on reload. Also, there's a #C053K90BR channel where you'll get quick answers to all your boot related questions. Both boot and lein are great options, keep on with boot
If I have to write JS, what library can I use to have all the familiar CLJS data processing functions, or sth like? Will Mori work, or are there any others?
Or, if I have JSON (already parsed, 4-5 levels nestedness), can I turn it into immutable/easier-to-handle DS easily?
Though this should do: http://swannodette.github.io/mori/#toClj
Does anyone know the correct way to type hint numbers in clojurescript now? This breaks under 1.8 https://github.com/lbradstreet/instaparse-cljs/blob/master/src/cljs/instaparse/auto_flatten_seq.cljs#L37
I was following what clojurescript core did, but now it uses a bunch of macros everywhere to do the same thing, and I’d rather not resort to that.
@lucasbradstreet: I think that the typehint should go before the function name symbol: https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/core.cljs#L1181
Hmm. Good point. I’ll give that a try. Thanks!
Hi. Silly question: Is there a way to use multimethods in different namespaces without actually requiring them somewhere (just the defmulti)- like dynamic load or something? Thank you.
@bojanx100: there is not
Any known issues with js interop on advanced cljs builds? Calling the momentJS from an unminified build works, but fails in a minified production build:
(defn moment [arg] (.moment js/window arg))
(defn smile-box [data]
[:div
[:div.text-center.text-muted (-> (moment (:timestamp data)) (.fromNow))]
[:br]])
I suspect that .moment is being mangled somewhere for minification.aside, using reagent.
@petrus: are you using cljsjs/moment?
No. will try that, thx @martinklepsch
For advanced compilation you need externs. There's more on the whys and hows here: https://github.com/cljsjs/packages/wiki
@petrus: are you including moment in your externs?
How you load google maps JS api in your ClojureScript apps? just add a script tag? or is there something more -y that could be done? I'll give goog.net.jsloader/load
a try but curious about other approaches
(defn load-gmaps! []
(doto (loader/load (str gmaps-uri gmaps-api-key))
(.addCallbacks
(fn [] (js/console.info "GMaps API loaded"))
(fn [] (js/console.info "GMaps API failed to load")))))
Guess that'll do.Unfortunately the API always returns success even if the api key is invalid
http://json-schema.org/ is probably the closest equivalent
on the interop front, has anyone tried/been successful at packaging/calling the AWS SDK? It's not in CLJSJS, but assuming that's because proprietary, I figure someone must have some experience with it.
that's what I was thinking.... I'm not terribly confident in cljs yet, so I was hoping someone had already gone down that path. but then again, getting my hands dirty would be good experience.
@curtosis: There's a #C0E66E1H7 channel where you can ask questions if you're stuck