This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-06-08
Channels
- # admin-announcements (61)
- # beginners (42)
- # boot (16)
- # cider (3)
- # clojure (43)
- # clojure-brasil (6)
- # clojure-france (4)
- # clojure-germany (8)
- # clojure-japan (5)
- # clojure-nl (1)
- # clojure-russia (36)
- # clojure-sg (2)
- # clojurebridge (2)
- # clojurescript (129)
- # datomic (29)
- # editors (42)
- # euroclojure (8)
- # jobs (1)
- # ldnclj (44)
- # off-topic (9)
- # overtone (2)
- # reagent (1)
@quentin: This is because your project.clj
specifies a version of ClojureScript that requires Clojure 1.7.0-x, but with Clojure 1.6.0 specified.
@quentin: One useful tool for diagnosing mismatched dependencies is lein deps :tree
.
In this case it would emit
Possibly confusing dependencies found:
[org.clojure/clojure "1.6.0”]
overrides
[org.clojure/clojurescript "0.0-3308"] -> [org.clojure/clojure "1.7.0-RC1”]
I've been running figwheel in a terminal, but I've finally decided to give inf-clojure in emacs a try. It seems to be working okay, but I oddly never get another repl prompt after the first one. I can evaluate things in the \inf-clojure\ buffer directly, or from other buffers, and results show up, but no prompt. Has anyone seen this?
huh, figured it out, kind of, but it's odd. In my dependencies, I was grabbing the aot'd versions data.json and tools.reader, and then excluding them from the deps that clojurescript itself pulls in, like so:
[org.clojure/clojurescript "0.0-3308" :classifier "aot"
:exclusions [org.clojure/tools.reader org.clojure/data.json]]
[org.clojure/data.json "0.2.6" :classifier "aot"]
[org.clojure/tools.reader "0.9.2" :classifier "aot"]
Removing data.json and tools.reader, as well as the :exclusions
makes the prompt bug go awayanyone familiar with http://thi.ng? when including http://thi.ng/color in my cljs project, i seem to only get access to a small subset of the core functions
seems like for example core/rgba->css is compiled into core.js, but it doesn't become part of thi.ng.color.core in the js console
@sander I am not familiar with http://thi.ng but here is a talk from Karsten: https://skillsmatter.com/skillscasts/6425-all-the-things
Any pointers to cljs.test documentation? I keep running into the announcement (https://groups.google.com/forum/#!topic/clojure/gnCl0CySSk8) but not much else.
@ricardo: should be just like clojure.test — the stuff you’ll need to take care of is running it and there are a few approaches out there I think
@martinklepsch: That's what I've read, but even a trivial test is (apparently) stuck. Not sure if it's some set up issue I'm missing.
For instance, my ClojureScript code references a .js library. I'm not sure how to specify these imports, so I'm getting a ReferenceError. Unclear on if that's what's causing the test not being run, though.
@ricardo: if you depend on external JS lib, you should add :foreign-libs [{:file "path/to/lib.js" :provides ["lib-namespace"]}] to cljsbuild configuration Then you can require lib-namespace in your CLJS
or maybe your JS library is already packaged via CLJSJS: http://cljsjs.github.io/
@ricardo we try to keep the wiki up-to-date with information about stuff like this - https://github.com/clojure/clojurescript/wiki/Testing
Thanks @dnolen, not sure why that one hadn't come up. You may want to change the URL for the readme here https://github.com/Prismatic/cljs-test so that it points to the wiki page.
Currently it points to the announcement, which is what I kept finding on my searches.
Oh, my bad. Been looking at so much stuff that I'm sort of code blind right now. Going to file an issue for them.
@ricardo: to use external JS lib inside CLJS, have a look to https://github.com/clojure/clojurescript/wiki/Dependencies
This has been bugging me... https://github.com/emezeske/lein-cljsbuild/blob/master/sample.project.clj#L62-L66 The cljsbuild sample project states that :builds
should be a sequence of maps, but on the examples is set to a map of configurations with what looks to be like the configuration as the key.
reading lein-cljsbuild code, seems that both are valid. map of configurations are converted to sequence of maps: https://github.com/emezeske/lein-cljsbuild/blob/master/plugin/src/leiningen/cljsbuild/config.clj#L39-L44
Hmm, in fact I think I just stumbled into a case where the map works better @bhagany @bcachet
Profiles on lein are merged. If you declare your :builds
as a list of maps, instead of a map, then when you try to alter just one value on a profile you end up with one more build configuration
Yeah, it just bit me. I was wondering why it was trying to build a cljsbuild-main.js that failed as if some foreign-libs weren't specified (and as a third configuration)
Thanks @ricardo I will be more careful when creating builds. I have to say that I move to boot build tool because I find it easier to setup when configuring complex tasks (reload page when JS/CSS are modified)
Anyone had an issue where you run lein cljsbuild test
using phantomjs, the tests run and the report is printed, but the process doesn't seem to exit?
@ricardo: that’ll probably happen if you’ve installed something into the browser event loop somehow (setInterval, setTimeout etc.)
@ricardo: does it quit after 30sec ? https://github.com/emezeske/lein-cljsbuild/blob/master/plugin/src/leiningen/cljsbuild.clj#L22-L37
@ricardo I wrote a little article about cljs.test, I guess it can be useful for you - https://nvbn.github.io/2015/06/08/cljs-test/ 😃
@dnolen: Wondering if there’s a better way to do this https://github.com/uswitch/tools.reader/blob/master/src/main/cljs/cljs/tools/reader/impl/utils.cljc
Macro to selectively compile based upon cljs build number
@andrewmcveigh: nothing comes to mind
Hmm. In Om, what are the conditions under which I might be able to change the application state without triggering a re-render
@dnolen: OK, thanks. Is that kind of thing “acceptable”? I’m not too fond of it, but couldn’t think of any other way.
@zane: see commit!
, it’s worth skimming the source from bottom to top at least once to see what is there.
@andrewmcveigh: you need to detect the version, not sure what else you can really do.
@dnolen: fair enough, thanks.
@dnolen: Oh. I'm actually trying to schedule a re-render, but am failing. I see my application state changing, and I see render
being called in the relevant components, but the DOM isn't being updated somehow.
Hi all! Is there a reason why in cljs when I use comp
to compose functions the number of args is not checked when I call the composed function ?
and we don’t do anything for higher order usage, would require a much, much more sophisticated analysis
@mfikes @bcachet I guess something like that should be formalized in some library, or added to cljs wiki
There shouldn't be any problem with putting a communication channel in Om's shared state, right?
none at all. we do this all the time!
just be aware that shared state can’t be altered once it’s set - you have to put the chan (and any other ‘global’ service items) in at om/root
@robert-stuttaford: Yeah, no problems there.
Somehow I've gotten myself into a state where some updates to the app state trigger a re-render and some don't.
you need to om/observe
in the render method of the components you want to re-render
The one remaining issue I have is that reordering data within a vector doesn't trigger a re-render. Is that to be expected?
how are you doing the reordering?
@robert-stuttaford: Swapping two values via assoc
.
mind sharing a snippet?
i know Om fully supports vectors as cursors through IndexedCursor
@nvbn: I haven't looked into phantom in detail, but I think with version 2 you can't do phantom.args[0]
any more and will need to yse system.args. Found that while following up on this: https://gitlab.com/keeds/cljsinit/issues/1
@ricardo I'll try 2+, but probably replacing phantom.args
with system.args
will be enough
@ricardo also, have you tried phantomjs 2+, is react works out of the box (without es5-shim)?
I've just got the basic tests working at the end of the day today. Haven't gotten far enough to test that.
@dnolen: why does Om pass current state to will-update instead of the next state? https://github.com/omcljs/om/blob/master/src/om/core.cljs#L363
@ul that’s not what happening, -get-state
returns the next state, you need to read through all the state implementation if you want to understand how it works
@dnolen: sorry for dumb questions, but get-state
calls -get-state
, thus I have no chance to get prev state in non-hacky way inside will-update?
@ul I do not write documentation for my own enjoyment please look at this https://github.com/omcljs/om/wiki/Documentation#get-render-state
I'm writing a small browser-based game with ClojureScript, which I am not too familiar with. I'm wondering if it would make sense to write the logic parts as cljx files? Is there a point to that?
I could imagine it would be easier to use e.g. test.check if it's cljx and not all straight cljs
@jstaffans: cljx is effectively superceded by .cljc
I'm having a bit of confusion about when to use om/build
on a "component", and when it's okay to simply use normal Clojure functions and calls to om.dom
.
That is to say, if two parts of the render tree differ by values that will be fixed over the lifetime of the application must I always store those differences in component-local state, or is it acceptable to use a function that takes data
, owner
, and the additional state as arguments instead?
Hey, wrote a bit on polymer and reagent. https://gist.github.com/MrNice/b64f6b5b98a64433d0b4
Looks good @maria thanks for sharing the status update.
@dspiteself: No problem
@maria: will there be a different path/configuration for the commonjs modules that after conversion can vs cannot advanced compile.