This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-14
Channels
- # admin-announcements (2)
- # beginners (8)
- # boot (75)
- # clara (2)
- # cljs-dev (3)
- # cljsjs (39)
- # cljsrn (1)
- # clojure (75)
- # clojure-brasil (3)
- # clojure-dusseldorf (13)
- # clojure-gamedev (1)
- # clojure-mexico (1)
- # clojure-quebec (5)
- # clojure-russia (30)
- # clojure-sg (3)
- # clojure-spec (25)
- # clojure-uk (65)
- # clojurescript (36)
- # core-async (1)
- # cursive (15)
- # data-science (6)
- # datomic (38)
- # devcards (29)
- # editors (1)
- # emacs (11)
- # funcool (6)
- # hoplon (43)
- # immutant (48)
- # lambdaisland (2)
- # leiningen (9)
- # mental-health (4)
- # mount (1)
- # numerical-computing (1)
- # off-topic (4)
- # om (19)
- # onyx (1)
- # pedestal (1)
- # proton (1)
- # re-frame (21)
- # reagent (1)
- # specter (8)
- # sql (3)
- # testing (14)
- # untangled (9)
- # yada (31)
Hi folks, apologies for possibly an obvious question. I'm getting an error as follows trying to write the equivalent of
new PDFJS.DefaultTextLayerFactory()
clojurescript:
(new js/PDFJS.DefaultTextLayerFactory)
error:
memo.cljs:70 Uncaught (in promise) TypeError: PDFJS.DefaultTextLayerFactory is not a constructor(…)
hmm. It seems that it's defined like this in pdf.ext.js in the clsjs package:
"PDFPageView": {
"setPdfPage": function () {},
"update": function () {},
"draw": function () {}
},
"DefaultTextLayerFactory": {}
I don't know if that means there is only one object, and if so how I can access its members?@adamw: I’m using the pdfjs package from cljsjs and it seems that there is no such thing as PDFJS.DefaultTextLayerFactory
https://github.com/cljsjs/packages/blob/master/pdfjs/resources/cljsjs/pdfjs/common/pdf.ext.js
@rohit: also it seems like our version of pdfjs is lagging a -looong- way behind pdf/js current
need to learn how this clsjs packaging thing works; I don't understand what the .ext.js file actually does
@rohit: one thing I don't understand. So those definitions in the extern file (PDFPageView/DefaultTextLayerFactory) are from viewer.inc.js, not from pdf.js. This discussion (https://github.com/cljsjs/packages/pull/143) seems to imply that somehow this works, but I would have thought we would need another .extern file for viewer.inc.js, or can we just munge it into one file?
@adamw: lets talk on #C0E66E1H7. Seems to be that the deps.cljs file for it may not be accurate
Hi. I'm in the process of adding specs to a Clojurescript application, and I am seeing some poor performance. Running through the test suite without instrumentation takes about 15 seconds on my laptop. After adding a call to instrument-all in my test runner it takes about 5 minutes. This is after adding specs to only a couple of namespaces. Is this to be expected, or does it indicate that I am doing something wrong?
It seems that higher order functions are the main culprit. For example, an invocation of this function:
(defn- alter-active-word
[words f]
(mapv (fn [word]
(if (active-item? word)
(f word)
word))
words))
(s/fdef alter-active-word
:args (s/cat :words :command-line/words
:f (s/fspec :args (s/cat :w :command-line/wordwrap)
:ret :command-line/wordwrap))
:ret :command-line/words)
runs in 0.20ms when not instrumented and 314.17ms when instrumented.Hi, is there something like alias
in cljs? I like to define an alias for a namespace which doesn’t exist only to be able to use shorter namespaced keywords.
anybody know of a way to detect if a PersistentVector is a map entry when using prewalk in cljs?
@hueyp: yes that works if I define the alias in :require
but than the namespace has to exist - I just don’t have the namespace in cljs - it comes from the server
does anyone know if it’s possible to use https://github.com/dgrnbrg/spyscope in CLJS?
or maybe there’s a way to “inject” stuff with figwheel? then I could use
[taoensso.timbre :refer-macros [spy]]
?
posted this in #C0620C0C8 but but thought I would add it here too — has anyone used https://github.com/airbnb/enzyme with clojurescript?
@schmandle: to be expected, but I know they are still collecting feedback
@schmandle: at this point probably better to demonstrate what you are doing with clojure.spec and report that on the Clojure mailing list - cljs.spec is more or less a direct port
@akiel: doesn’t exist yet, but there’s some discussion bubbling around that for Clojure, you should make your desire know there - we’re only going to get it if Clojure gets it