This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-07
Channels
- # admin-announcements (4)
- # beginners (11)
- # boot (94)
- # cider (12)
- # cljs-dev (87)
- # clojure (64)
- # clojure-austin (1)
- # clojure-australia (3)
- # clojure-canada (1)
- # clojure-dev (7)
- # clojure-russia (28)
- # clojurescript (292)
- # datomic (2)
- # editors (1)
- # events (4)
- # hoplon (35)
- # instaparse (56)
- # ldnclj (10)
- # off-topic (141)
- # re-frame (2)
- # reagent (2)
No such namespace: cljsjs.react, could not locate cljsjs/react.cljs at line 1 file:/root/.m2/repository/org/omcljs/om/0.8.8/om-0.8.8.jar!/om/dom.cljs
Does lein deps :tree show a cljsjs/react dependency?
@shofetim: what version of cljs?
From many google searchs it seems like anything more recent then 3115 should have all potentially related bug fixes.
Upon upgrading to 1.7.58, from 0.0-3308, I'm having a problem with cljs.test
. Specifically, a call to cljs.test/run-tests
appears to be macroexpanding to include a call to cljs.core/vswap!
(here: https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/test.clj#L268), which is failing with Use of undeclared Var cljs.core/vswap!
. I've inspected the generated javascript, and it's true that cljs.core.vswap_BANG_
is in the bit generated by run-tests
, but it's not in the generated source for cljs.core
. cljs.core.swap_BANG_
is defined there though. Has something changed here recently?
If I'm reading it right, I think that calls to vswap!
in cljs.core get compiled to cljs.core._vreset_BANG_
… not sure if that's relevant but it seems interesting
@shofetim: still half sleeping but have you tried explicitly depending on most recent cljsjs/react?
@bhagany I was just looking into http://dev.clojure.org/jira/browse/TCHECK-61 today, which seems like a similar issue. Have you tried adding (:require [cljs.core]) in your ns?
Also, how are you requiring the macro? (:require-macros ...) or (:require ... refer-macros ...)?
like this: [cljs.test :as test :include-macros true :refer [report]]
- I believe I cribbed that from a gist for testing with figwheel
ah, this isn't going to be quick, I don't have any non-dev environment (read: a page that's not expecting figwheel) to run this
vswap! is a macro, so maybe you could try adding (:require [cljs.core :include-macros true])
ok... I have have to say: yes, something has changed 😛. I guess you could try to track down which version between 0.0-3308 and 1.7.58 brings this issue
@bhagany: seems unlikely to me at the moment. I’ve been using cljs.test
with 1.7.X without issue.
make sure you don’t have some weird caching issues or somehow have conflicting versions of ClojureScript.
Does anyone know why a javascript function if you
aget
it with clojurescript loses it's this binding? I am writing (.bind (aget "matcher" "setRows") (aget "matcher"))
everywhere 😞@mitchelkuijpers: that’s how JavaScript works
Aha that was actually what I wanted to ask
but easy to write a macro bound-fn
, or plain function too, so you only write (bound-fn foo “methodName”)
Sure but I can just write a function if it bothers me to much
Btw pretty awesome stuff the buit-in google closure stuff, currently using AutoComplete ^^
@mitchelkuijpers: if you’re using Google Closure then you do not want goog.object/get
either
I can just call the functions with google closure right? like
(.setRows matcher)
@mitchelkuijpers: yes, I’m just trying to explain based on what you’ve said so far
@dnolen: true the reason I need them right now is because i am wrapping a google closure component as a reagent component, where i need access to the matcher and I did a dirty hack where i set the matcher on this in
component-did-mount
link this (aset this "matcher" matcher)
But this was a bad idea so refactoring it already
@dnolen - interesting… I had considered conflicting versions of clojurescript and had already pruned lein deps :tree
, but per your suggestion I decided to clear my local .m2
and try again. And then I watched it pull down four (!) ancient versions of clojurescript, none of which appear in lein deps :tree
. My lack of understanding runs deep. I'll investigate further, thanks for the nudge.
also, if anyone has any clue what I'm missing about that, I will humbly accept your correction
@bhagany: be sure to clean your output dirs... lein clean
but depending on your cljsbuild profile you might need to manually check everything is wiped
I mean, lein clean
only wipes :target-path
, but it's common to have output in other dirs as well, if that's the case you can configure :clean-targets
but in the meantime clean it manually
@bhagany: I had the same issue a while back. Doing what @nberger like so, :clean-targets ^{:protect false} [:target-path :compile-path "resources/public/js"]
worked for me
(your paths may be different)
then lein clean
of course
@bhagany: also, about the 4 ancient clojurescript versions pulled, I think lein might be pulling the entire dependency tree based on your declared dependencies but ignoring :exclusions
and also including every declared clojure & clojurescript dependency in your tree
it's just that when building the classpath, it will apply your :exclusions
and your declared clojure & clojurescript versions will take precedence (or it simply ignores the versions declared in your dependencies, not sure about this)
I believe it’s pulling all mentioned versions just to get their transitive dependencies - for aether (?) dependency resolution algorithm
@dnolen: wondering if 1.7.58
is a pre-release
@shaunlebron: occasionally we cut quickfix releases for some users that need no more extensive announce
k thanks
@nberger, @bostonaholic I've been cleaning my compilation targets on every run Also, good to know, regarding the dependency tree/exclusions interaction
To try to get down to a more minimal repro, I started a new project with minimal dependencies. It still pulls 0.0-2411, but I haven't tried compiling anything that calls run-tests
yet. I'll try to make some time for more exploration around lunch time. Thanks for the help!
Starting off a new clojurescript project that will likely involve svg; recommend lein template?
Planning to use Google’s material design for interface, unless there are better recomendations? (Only really need sliders)
many CSS frameworks assume jQuery and/or implement sliders and dropdowns through direct DOM manipulation.
I've looked at this in the past http://material-ui.com/#/components/sliders
Incase wasn’t here yet. Good read from the guy behind DataScript http://tonsky.me/blog/the-web-after-tomorrow/
zspencer: Are you sure material-ui relies on jquery? The changelog and issues lead me to believe that it doesn't require jquery.
but then I realized who you were after Is ent it and was like “Ah, we know each other kinda, what the hay!"
@nberger @bostonaholic - I've done more experimenting, trying to narrow the issue down, and this is about as far as I've been able to get: https://github.com/bhagany/flarg
Basically, compiling in the quickstart way outputs something slightly different from compiling via cljsbuild (yes, I know)
My goal here though is to continue using figwheel, and I'm unaware of any hoops to jump through to do so without cljsbuild
I should add, both the cljsbuild output and the build.api output claim to have been compiled with clojurescript 1.7.48
@bhagany: I might be missing some context, but is the clojurescript :aot
flag intentional?
hmm :aot
is great when everything is working and you want to speed up your compilation process. not so good for finding deps related problems
@zspencer: I used http://materializecss.com/ with not too much pain
you can get really far with just channels and making sure you never mutate state in the components
i haven’t had the need to go outside the readme (and it’s wiki) to do anything with re-frame
you might say some browsers aren't really able to appreciate the way it lays out its code
dude I just have use reagent.session
to put all app state create a bunch of reagent.core/cursor
that i pass to my components
then create chans to communicate your components with some data mutation functions in your main namespace et voila
is https://github.com/jarohen/chord a good choice?
That or sente - https://github.com/ptaoussanis/sente
the only difference would be supply more information for people who want to turn it on.
I actually started thinking about this again because there isn’t a good doc solution for Clojure or ClojureScript
in anycase this isn’t about treading into core.typed territory or messing with type hints
when it comes to built in types it would work like "@param cljs.core.PersistentHashMap"
:pre conditions can be arbitrary functions, I'm trying to look how can they be added to jsdocs
Is there a way to read resource files so they’re available to Clojurescript? I’m okay with doing all my reading at compile time.
Maybe I should also explain the more general problem I’m trying to solve, just in case there’s an even better solution
bensu: now that I have you here, by the way, have you ever considered using lein-auto for the “repeat” behavior for doo? I haven’t checked if that would let you shave off some code.
Does clojurescript support (:use-macros [my.ns :refer [macro1] :rename {macro1 macro2})
?
0.1.4-SNAPSHOT allows :optimizations :none for all platforms but rhino, changes valid-compiler-options?'s signature to take js-env, adds the browsers alias, and changes many of the compiler requirements.
on lein-auto, the cljs.watch.api
lets me write all of lein-doo
in 5 lines. (which feels like all of cljsbuild
)
@aengelberg: no support for :rename
at all
@cfleming: yeah Node.js debugging mostly works, at least as well as in the browser, the only janky bit is I have to set breakpoint in generated JS
I tried to play around with spy-js when writing some JS the other day but couldn’t make it work.
:debug-port
means you can of course use anything (node-inspector) or whatever, but happy that IntelliJ JS support works well enough for me to stay in the IDE
That’s nice. JetBrains seemed fine with giving me access to the source, but I’m pretty backlogged right now.
(extend-protocol IComparable IFn (^number -compare [x y] (println "compare function") (cond (identical? x y) 0 (< x y) -1 :else 1)))
@sonnyto: you cannot extend protocols in ClojureScript, you can’t do that in Clojure either
Clojure does support extending Java interfaces though, and that’s not really possible in ClojureScript
(extend-type IComparable default (-compare [x y] (if (and (fn? x) (fn? y)) … (throw (ex-info …)))))