This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-28
Channels
- # aleph (3)
- # beginners (10)
- # boot (135)
- # clara (2)
- # cljsjs (2)
- # cljsrn (1)
- # clojure (68)
- # clojure-austin (4)
- # clojure-france (2)
- # clojure-japan (1)
- # clojure-spec (30)
- # clojure-uk (11)
- # clojurescript (48)
- # component (65)
- # cursive (5)
- # datomic (40)
- # dirac (5)
- # emacs (3)
- # events (16)
- # funcool (2)
- # klipse (46)
- # lein-figwheel (2)
- # luminus (8)
- # off-topic (4)
- # om (7)
- # other-languages (4)
- # parinfer (21)
- # re-frame (15)
- # reagent (30)
- # ring (1)
- # ring-swagger (9)
- # rum (3)
- # specter (7)
- # test-check (8)
- # testing (5)
- # vim (21)
- # yada (4)
In clojurescript 1.9.229:
(let [{:keys [ui/foo] :or {ui/foo 0}} {}] foo)
returns nil
but in clojure 1.9-alpha13 it fails with
ExceptionInfo Call to clojure.core/let did not conform to spec:
In: [0 0] val: {:keys [ui/foo], :or #:ui{foo 0}} fails spec: :clojure.core.specs/local-name at: [:args :bindings :binding :sym] predicate: simple-symbol?
Is this a bug?why does slacks outgoing webhook api send things as x-www-form-urlencoded? its terrible
@adambros not a bug, the correct form would be (let [{:keys [ui/foo] :or {foo 0}} {}] foo)
any idea why :preamble doesnt seem to work with modular compilation ? I want to prepend importScripts() to the start of my generated js
Anyone encountered this error before? > Uberjar aborting because jar failed: nth not supported on this type: PersistentArrayMap
I’m trying to generate a jar file to deploy a small application built in leinigen/figwheel…
@ezmiller That's a fairly generic error, it suggests that you're doing some code like (nth {} 2)
, but nth
doesn't support {}
There’s nothing in the way of a stacktrace strangely. I only see the error when I run lein uberjar
. When I run lein figwheel
everything is fine. Hmmmm.
could be AOT related?
@ezmiller you could try turning aot off entirely if that's possible when building an uberjar (the uberjar is useless/non-functional in that case so I'm not sure it's a supported option)
that said I guess figuring out why there is no stacktrace might be something you'll want to do at some point so you might as well do it now
The project.clj has the following for uberjar: https://s3.amazonaws.com/ezmiller/public/images/2._nvim_Python_2016-10-28_16-00-46.png
can you tell me why this doesnt work?
… promise
(.then #js (fn [& args] (.log js/console #js args))
#js (fn [& args] (.log js/console #js args))
you don’t need to #js a function def, @mping
only datastructures
e.g. #js [”one” “two”]
@mping that's right. #js args
doesn't work, it must be used with literal notation, i.e. #js [1 2 3]
you can use clj->js
to convert from Clojure data structures to JS's
alternatively, if all you want to do is print ClojureScript's persistent data structures into a readable console form, use println
instead of console.log
thanks, doesn’t work because its a reader macro and reader macros work on “macro-time” right?
reader-time 🙂
reader -> macro-expansion -> runtime
(which is why you also can't use #js
in macros)
reading has happened at that point
thanks for the explanation. the generated println code is quite nasty but I guess thats the price to pay 🙂
Hi I have a question regarding converting ClojureScript datasctructures to JS, I’m trying to convert following map to JS object
(clj->js {
:title “Downlo”
:description "This graphic shows a time-series of downloads."
:data [{ :date (js/Date), :value 12}
{ :date (js/Date), :value 18 }]
:width 600
:height 250
:target "#graph"
:x_accessor "date"
:y_accessor “value”
})
However, it seems to convert Date
objects to string, is there a way to avoid that and keep the Dates as JS Dates ?@mping, you might take a look at the shodan and devtools libraries for cljs logging, if you haven't already seen them
Hey, I've got maybe kind of a naive question. I'm working on some cross-platform (clj/cljs) code which exposes a common interface but uses two wildly differing implementations of an underlying parser; they're different enough that I don't want to use CLJC for the files because they're not really very similar. So now I'm considering having two files, parser.clj
for the Clojure implementation and parser.cljs
for the ClojureScript one.
Good idea? Bad idea? Something about it doesn't quite feel right, but it would probably simplify the calling code somewhat
what about doing something like parser_impl.clj
and parser_impl.cljs
and then have parser.cljc
that just calls simple wrapper functions?
That was basically my plan, yeah
I'm sort of waffling besides that and having like parser/clojure.clj
and parser/coljurescript.cljs
@anmonteiro:
> (which is why you also can't use #js
in macros)
what is a recommended way to do this in macros?
It's keeping the namespaces the same but varying the extensions that has me looking a little askance at it
@peterschwarz cljs.core/js-obj
and cljs.core/array
Thanks