This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-21
Channels
- # admin-announcements (2)
- # beginners (22)
- # boot (223)
- # cider (161)
- # cljs-dev (19)
- # cljsrn (4)
- # clojure (186)
- # clojure-austin (6)
- # clojure-beijing (1)
- # clojure-boston (3)
- # clojure-china (1)
- # clojure-czech (1)
- # clojure-france (1)
- # clojure-greece (10)
- # clojure-russia (17)
- # clojure-uk (154)
- # clojurebridge (3)
- # clojurescript (82)
- # component (12)
- # cursive (12)
- # datomic (71)
- # dirac (3)
- # editors (2)
- # emacs (29)
- # flambo (31)
- # hoplon (21)
- # immutant (11)
- # instaparse (17)
- # jobs (2)
- # jobs-discuss (2)
- # jobs-rus (1)
- # lein-figwheel (12)
- # leiningen (2)
- # off-topic (44)
- # om (78)
- # onyx (38)
- # parinfer (1)
- # re-frame (34)
- # reagent (32)
- # spacemacs (56)
- # untangled (74)
- # vim (12)
- # yada (2)
I’ve been using doo, but doo won’t report full stack traces when an error occurs in the test which limits the helpfulness of tests sometimes
@dmh43: I’ve used Karma directly which works pretty well
I'm trying to load a script from vimeo's and on my first attempt here I've added it into the DOM as a <script>
. It shows up in debugging in the DOM but is not actually loaded and claims that the Vimeo var isn't loaded. I'm using Reagent but I don't think that's what's going on. Is there some Browser/JS/Cljs thing I might be overlooking?
using https://github.com/honzabrecka/karma-reporter and https://github.com/honzabrecka/karma-cljs-test
I need to write a blog post about it
@danielcompton: oh cool. Thanks!
@tom your description is a bit vague, you might need to give some more details
(defn vimeo-js-api []
[:script {:src ""
:type "text/javascript"}])
And when that's rendered in with other components it shows up when inspecting elements. However, the sources and network don't show it as getting loaded. If I hardcode the script into the HTML head then it does load.@grav yep, I’ve used it in the past and still have a project on it
@danielcompton: I have a problem with external dependencies. I’m running with phantomjs as runner, and if I do not set my target's :optimizations
to :whitespace
, it cannot find Google Closure (eg ReferenceError: Can't find variable: goog
)
yikes. I haven’t used phantomJS with Doo, does it do the same with the Chrome Karma runner?
@danielcompton: is there an easy way to getting started with Chrome Karma?
It’s a pain if you’re on windows, but ok on OS X or Linux
Anyone have a thought on the best way to initialize a server call based on a change to app-state in om.next?
ie. After a user logs in (change to app-state), fetch other information about the world from that user’s perspective?
Ok - I think the way to go is to follow the pattern in the remote synchronization tutorial; but I am a bit confused about how the reconciler invokes the :send method.
In the remote synchronization tutorial section demonstrating how to make an auto-complete search widget, they suggest the following read function: `(defmethod read :search/results [{:keys [state ast] :as env} k {:keys [query]}] (merge {:value (get @state k [])} (when-not (or (string/blank? query) (< (count query) 3)) {:search ast})))`
I see that “:search” is registered in this example as one of the remotes - does this mean that the result of this read function triggers the reconciler to attempt to read :search and thereby trigger the :send function for remote reading?
For ref - this is the tutorial I’m looking at: https://github.com/omcljs/om/wiki/Remote-Synchronization-Tutorial
@mattyulrich: there’s an #C06DT2YSY specific channel
Oh - thanks.. switching there.
can someone explain to me why a compilation of :advanced
throws Uncaught TypeError: re-find must match against a string.
in the following example? (capturing status from xhrrequest using google xhrio lib)
(def api {:login "/api/login"})
(defn capture [response]
(if (> (.. response -xhr_ -status) 299)
response
(let [url (.. response -xhr_ -responseURL)
capture? (re-find (re-pattern (:login api)) url)]
(when capture? ...))))
If I do some debugging, it looks like url
is undefined/null
in the javascript… which makes me think the compilation is somehow bashing response.xhr_.status?I was hoping I wouldn’t need to do the whole externs.js
stuff, particularly because i’m using the closure xhrio lib and not some third-party.
@lwhorton: the _
usually indicates that thing_
is private in Closure. I'm not sure if externs could work differently in this case but maybe try finding a "non-underscore" way...?
@lwhorton: I have never needed externs for anything coming from
hah, silly me… i’m in there rooting around in internals and the has a whole bunch of .get{accessor}
methods.
yup @martinklepsch that was exactly the problem, thanksa gain.
Hello, is it normal that (clojure.set/union #{1 2} [3 4])
returns #{1 2 3 4}
but (clojure.set/union #{1 2} [3 4 5])
returns [3 4 5 1 2]
?
So when you try it on simple input set and vector and it works - it seems that it will work on all vectors.
@jr: does it mean that if i union sorted set with simple set - behaviour will change depending on sets sizes?
@nidu right passing in anything other than sets is undefined as @mfikes said, and no guarantee about preserving the type of set
@dnolen: totally understand. Just thought it might work, Clojure methods often allow multitude of different parameters as i tend to think
I wonder if there is work out there similar to @mfikes has done with JavascriptCore which targets v8
@pyr: If you want a bootstrap REPL that runs in Node, there is the following. It works, but it has not had any real effort or polish put into it: https://github.com/mfikes/elbow
about bootstrap test
I was thinking of adding something to replumb
actually we were discussing with Mike to either spawn a new project or add stuff to replumb
and I am kind of torn because maybe I am putting too many things in replumb
Yeah, the thinking is that libs that want to ensure compatibility with bootstrap ClojureScript (by running their existing cljs.test
tests in a bootstrap environment), will want an easy way to achieve that. https://github.com/mfikes/titrate illustrates that it is possible, but there is a lot of boilerplate that can probably be factored out into a lib that the community can use.
specljs offers a cli, and their recommended cljs setup is to use a runner.js file that pulls in phantom, then uses phantom’s injectJs
and evaluate
to injec the compiled spec files, then evaluate the result of running those specs.
let’s call that runner file /bin/speclj
… we can’t directly invoke speclj /target/main.js
because the mainjs file is expecting to be run where there is a document
, and it dynamically attaches a cljs_deps.js
followed by goog.require(‘namespace.someUUID’)
.
i dont think phantomjs allows you to do stuff like document.write(‘<script src …’)
. because the closure main.js
file changes after each compile, we need a way to get that file (and the consequently required compiled cljs code) into a phantom environment so we can run the speclj
against it.
bookshlv.core=> (into #{} [(Uri. "") (Uri. "")])
#{#object[Object ] #object[Object ]}
bookshlv.core=> (clojure.set/union *1)
#{#object[Object ] #object[Object ]}
bookshlv.core=> (apply = [(Uri. "") (Uri. "")])
false
@telent: https://docs.oracle.com/javase/7/docs/api/java/net/URI.html#compareTo(java.net.URI)