This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-25
Channels
- # announcements (2)
- # babashka (35)
- # beginners (74)
- # calva (26)
- # cider (14)
- # clojure (74)
- # clojure-dev (27)
- # clojure-europe (9)
- # clojure-italy (2)
- # clojure-nl (2)
- # clojure-spec (10)
- # clojure-uk (9)
- # clojuredesign-podcast (6)
- # clojurescript (40)
- # data-science (1)
- # datalog (7)
- # events (1)
- # figwheel-main (13)
- # fulcro (11)
- # graalvm (58)
- # helix (4)
- # jobs (4)
- # jobs-discuss (9)
- # kaocha (23)
- # malli (5)
- # meander (112)
- # membrane (7)
- # off-topic (13)
- # pedestal (2)
- # re-frame (4)
- # reitit (1)
- # rewrite-clj (1)
- # rum (2)
- # sci (3)
- # shadow-cljs (79)
- # sql (12)
- # tools-deps (17)
- # vim (15)
- # vrac (11)
- # xtdb (6)
What is the difference between cljs-devtools and dirac-devtools?
It seems dirac includes more functionality, integrates chrome repl with nrepl etc…
Can you use dirac with shadow-cljs?
btw. dirac 1.6.0 added support for shadow-cljs REPL: https://github.com/binaryage/dirac/releases/tag/v1.6.0
Hey all - I have a few spots in sicmutils where I implement IFn
, and override all 21 arities: https://github.com/littleredcomputer/sicmutils/blob/master/src/sicmutils/structure.cljc#L154 Is there a more straightforward, idiomatic way to do this, like Clojure's override of (applyTo [s xs] (AFn/applyToHelper s xs))
I could write a macro of course, but maybe there is something cleaner
@sritchie09 IFn
etc in ClojureScript still need work, it's languished because it has considerably less utility due to ClojureScript fns being JavaScript fns
yes, makes sense for the usual case. here, we do things like make a tuple that acts like a juxt
and a seq, so ((up inc square dec) 10) => (11 100 9)
, etc
makes sense! @dnolen I definitely felt a little power coursing through the keyboard as I typed the final character of the 21st arity
there's a bunch of tests now so wouldn't be surprised if you have to chase some issues w/ apply
thanks for the heads up, as I start to test this more maybe this can be a first contribution area for cljs
I recently found a very minor fn typo in Lisp in Small Pieces and got myself on the errata list, so I'm feeling pretttty solid about my compiler hacking abilities
👍 yes, absolutely, if I find anything (even if not, I'll look for it) I'd be thrilled to contribute
Trying to get vega-embed working in cljs/shadow.
...
(:require ["vega" :as v]
["vega-lite" :as vl]
["vega-embed" :as vegaEmbed])
...
(let [vspec (->> {
"$schema" "https//vega.github.io/schema/vega-lite/v4.json",
"description" "A simple bar chart with embedded data.",
"data" {
"values" [
{"a" "A", "b" 28}, {"a" "B", "b" 55}, {"a" "C", "b" 43},
{"a" "D", "b" 91}, {"a" "E", "b" 81}, {"a" "F", "b" 53},
{"a" "G", "b" 19}, {"a" "H", "b" 87}, {"a" "I", "b" 52}
]
},
"mark" "bar",
"encoding" {
"x" {"field" "a", "type" "nominal", "axis" {"labelAngle" 0}},
"y" {"field" "b", "type" "quantitative"}
}
}
clj->js)]
(-> (vegaEmbed chart-div vspec (clj->js {:renderer "canvas"
:mode "vega-lite"
:logLevel v/Debug}))
(.then (fn [_]
(log/info "DONE WITH VEGA")))
(.catch (fn [e]
(log/error "ERROR IN VEGA" e)))))
Is giving me
TypeError: this.globalCursor is not a function
and points to this line in vega: https://github.com/vega/vega/blob/1f93346f7f54591698c0eb7cf8978f49b25e84ec/packages/vega-view/src/View.js#L73
Anyone have any hints?@jjttjj just a guess but since it wants to use this
maybe vegaEmbed.
not vegaEmbed
? hmm nevermind if it returns a promiseI guess not 😛
Can anyone point me to the magic incantation to load a npm-deps
like @angular/core
?
I'm actually trying to import @myorg/mylib
and not having any luck. I can get react to work through. I'm trying @angular/core
to verify that the mechanism works on a public library with an org/name but no joy. I've tried
:npm-deps {"react" "16.13.1"
"@angular/core" "10.0.12"}
With and without the @
and also
(:require
[react :as react]
["@angular/core" :as ass])
with and without the @
- any pointers?Have you tried using :target :bundle
instead of :npm-deps
and then try your require? :thinking_face:
Example: https://clojurescript.org/guides/webpack
I'm looking for a clever way to make my js/console.log display cleanly with and without cljs-devtools installed
Feels like it should be possible by using something like this...
(defn console-logger
[data]
(binding [*print-level* 3 *print-length* 5]
(js/console.log (with-meta (pr-str data) {:data data}))))
if cljs-devtools is installed you can drill into metadata
String form will work in all situations and not take too long to serialize
Obvious problem is that string doesn't implement the metadata protocol
I think the answer is something like: why not just specify! that protocol.
No joy with this. I'm guessing cljs-devtools tests for string before falling back to fancy behaviour. Looks like specify! doesn't work on a string.
(defn log-data
[data]
(binding [*print-level* 3
*print-length* 5]
(js/console.log (specify! (pr-str data) IMeta (-meta [_] data))))))