This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-12
Channels
- # aws (21)
- # aws-lambda (8)
- # beginners (53)
- # boot (56)
- # braveandtrue (1)
- # cider (49)
- # cljs-dev (8)
- # cljsjs (1)
- # cljsrn (57)
- # clojure (403)
- # clojure-austin (17)
- # clojure-dusseldorf (10)
- # clojure-greece (9)
- # clojure-spec (57)
- # clojure-uk (144)
- # clojurescript (60)
- # datomic (149)
- # docker (1)
- # emacs (1)
- # hoplon (23)
- # humor (1)
- # jobs (1)
- # leiningen (2)
- # luminus (1)
- # off-topic (1)
- # om (24)
- # om-next (15)
- # onyx (23)
- # protorepl (2)
- # re-frame (58)
- # reagent (90)
- # remote-jobs (1)
- # ring-swagger (4)
- # slackpocalypse (1)
- # spacemacs (2)
- # specter (18)
- # untangled (4)
- # vim (1)
- # yada (27)
@timsgardner I’m not aware of any specific way to deal with that, might want to bring that up in #clojure-spec since it’s not specific to ClojureScript really
@timsgardner also might want to mention it to bhauman when he’s around, there should be a knob for that no?
is secretary still the most popular client-side router? i see it hasn't been updated in 2 years. bidi seems more frequently updated but i don't really need bi-directional routing. any other suggestions?
pretty-formatting code in cljs, specifically xml. Bit disappointed not to see data.xml/indent-str
implemented in clojurescript. Any good maybe js libs that does this job well?
wondering if this is an expected behaviour of js-beautify?
cljs.user> (js/js_beautify "<note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note>")
"< note > < to > Tove < /to><from>Jani</from > < heading > Reminder < /heading><body>Don't forget me this weekend!</body > < /note>"
someone here that has experience with this libraryok, Im led to believe this website is using that library for its demo http://jsbeautifier.org/ very beautiful output I get from xml. At js-beautify they claim to beautify css and html as well.
Has anyone written some methods to convert edn->query string params and back again, so they look pretty and you don't lose any data, that they wouldn't mind sharing?
i doubt that works with edn, presumably i'd still have to write some code to convert into json
problem is converting back from json, so i don't lose data
I don't really understand what you mean by "edn" really, edn = clojure data structure once in Clojurescript, no?
i mean something like {:a 1 :b 2 :c []} -> ?a=1&b=2&c=%5B%5D
So, you'd do
(.toString (QueryData/createFromMap {:a 1 :b 2 :c []}))
I think (based on docs)going back is the problem...
query->edn
nevermind, i can write something quite easily, just thought it might already be out there somewhere
well, it is — compojure/ring/et al for example gives you a nice params map, so i’m sure some existing code exposes this nicely
indeed, just need to find it and convert to cljs
(import '[goog.Uri QueryData])
(let [x (QueryData. "a=1&b=2&c=%5B%5D")]
(zipmap (.getKeys x) (.getValues x)))
;; => {"a" "1", "b" "2", "c" "[]"}
i think i can JSON/parse then js->cljs the values
it should but no repeated keys in my case, so i can leave it
only thing im losing from cljs actually is proper date types, the rest converts quite easily to/from json
(import '[goog.Uri QueryData])
(let [x (QueryData. "a=1&b=2&c=%5B%5D&b=3")]
(into {}
(for [k (set (.getKeys x))
:let [val (js->clj (.getValues x k))]]
[k (if (= 1 (count val)) (first val) val)])))
;; {"a" "1", "b" ["2" "3"], "c" "[]"}
oh, quite nice, thanks 👍
don't worry, you've done enough 🙂
i have a great start
thanks!
My concern is that it should probably be (last val)
not (first val)
because I think last value wins.
Hi. Has anyone integrated a re-frame app with and existing JS app that's using require JS. Both apps are using require and I get a mismatched anonymous define error
With an*
@andres-alonso could you provide a more detailed description of how your app works, and possibly the stack trace?
I'll grab a stack trace when I head back to my desk, but the js app is using require JS and my cljs app is built using re-frame. When I include my app as the first script in the head it works, but I'd like to load it dynamically
Yeah so that sounds like a build system error; to be honest I have had similar errors but the solution is buried somewhere in configuration magic as far as I can tell
This person had a similar issue:
Unfortunately there's no resolution there either
I'll look into to foreign-libs flag thanks
just started delving into clojurescript (+ figwheel), as I want to make use of d3 for plotting. Used several other tools before when making plots in Clojure (lately, used quil). Trying to extend this d3 (v4) version example in clojurescript, and add an axis to the plot, but getting stuck.
https://github.com/lambdaisland/thirdpartyjs/blob/cljsjs-d3/src/cljs/thirdpartyjs/core.cljs
from what I read at d3's documentation, it should be as simple as adding two lines to the script. I tried this, and see no errors when figwheel updates the page, but also no axis.
inspecting the svg generated by my code, and in the http://bl.ocks.org/mbostock/3883245 example might help me debug. Still getting used to the browser's inspect window.