This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-25
Channels
- # bangalore-clj (2)
- # beginners (50)
- # boot (21)
- # cljs-dev (2)
- # cljsrn (1)
- # clojure (93)
- # clojure-russia (5)
- # clojure-spec (22)
- # clojure-uk (3)
- # clojurescript (24)
- # data-science (4)
- # datomic (1)
- # events (2)
- # fulcro (46)
- # graphql (9)
- # hoplon (16)
- # lumo (42)
- # off-topic (3)
- # perun (2)
- # protorepl (1)
- # re-frame (10)
- # reagent (12)
- # ring (1)
- # ring-swagger (1)
- # shadow-cljs (12)
- # specter (16)
- # unrepl (10)
I need a way to handle 'flick' events, these are events of the form: 1. user touches screen 2. user moves finger up/down/left/right 3. user removes finger from sreen so there is a "event down" + a movement event + a "event up"
Hi! I want to compile cljs to both nodejs and browser env. I've got it to work, but I also need to define env (nodejs or browser) in compile time. Is it possible to somehow define it? .cljc has reader conditionals: #?(:cljs ...)
. Could I define the similar conditional, something like #?(:cljs-node ...)
? thanks!
@zarkone in shadow-cljs you can define :reader-features #{:cljs-node}
for per build but the feature was refected from core so beware. https://dev.clojure.org/jira/browse/CLJS-2396
Is my understanding that CLJS does not support typed JS arrays correct?
If so, what would be the best way to implement a custom js->clj
? Using postwalk
?
@qqq I used hammertime, a js library, and bound it to a component to get this kind of events
@qqq https://github.com/gklijs/snake/blob/master/src/cljs/utils/sketch.cljs for some example of how I used it
@p-himik Assuming you had some suitable way to detect typed arrays, like an expansion of
(defn typed-array? [x]
(or (instance? js/Int16Array x)
(instance? js/Float32Array x)))
perhaps you could just first convert using js->clj
and then postwalk
that result, applying array-seq
to the typed arrays. For example
(let [int16 (doto (js/Int16Array. 2) (aset 1 3))
o #js {:foo int16}]
(clojure.walk/postwalk
(fn [x] (cond-> x (typed-array? x) array-seq))
(js->clj o :keywordize-keys true)))
If you want vectors in the result instead of sequences, perhaps compose vec
with array-seq
Perhaps prim-seq
is more appropriate than array-seq
(former works on JavaScript Array-like, later works on JavaScript array)
Any suggestions regarding popular libraries for CLJS tests?
cljs.test works, and I hear doo is good for running them
I set up my tests as a seperate build - using the same source files but the top level loads up the test namespaces and runs thetests
so I build the test cljs, then load the test shell in the browser to run the tests
Awesome! That seems straightforward. Any suggestions regarding coverage reports for CLJS?
I don't know about coverage tools, but I also haven't looked
Hi! I am getting a cryptic error (to me) when attempting to build my ClojureScript project for production (with advanced opts). Could someone please take a look? https://gist.github.com/hmaurer/1d30b39c8e28e646ebdfa524cbcdedb6
@hmaurer iirc that was caused by updating cljs but not tools.reader
or, more generally, if something is pulling in an outdated version of tools.reader, and it can be fixed by explicitly asking for the newer one
@noisesmith yep, problem solved. I had updated Clojure to 1.9.0-RC1 but not clojurescript
:thumbsup: