This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-07-10
Channels
- # admin-announcements (4)
- # beginners (21)
- # boot (85)
- # cider (31)
- # clojure (45)
- # clojure-australia (1)
- # clojure-berlin (2)
- # clojure-dev (7)
- # clojure-italy (10)
- # clojure-japan (17)
- # clojure-norway (8)
- # clojure-russia (2)
- # clojure-uk (15)
- # clojurebridge (1)
- # clojurescript (115)
- # code-reviews (13)
- # core-async (1)
- # editors (17)
- # euroclojure (5)
- # jobs (1)
- # ldnclj (9)
- # off-topic (5)
- # om (18)
- # re-frame (15)
- # reagent (25)
- # sydney (1)
I think I ran into this along the way, which is interesting. https://github.com/bhauman/lein-figwheel/issues/116
@bhauman: When I start figwheel in crashverse with lein figwheel test
and then add a new test in crashverse.core-test
figwheel doesn't appear to be picking it up.
If I run the tests in the REPL with (cljs.test/run-tests 'crashverse.core-test)
it picks them up.
@dnolen: is there something like cljs.test/run-tests
which takes specific deftest vars, rather than a wholesale namespace? (nevermind, found cljs.test/test-vars
- was expecting a macro not a function )
trying to write a function to generate all tetrominos (no de-duping for rotations yet). I think it works but I'm not sure how to avoid the nesting in the resulting data structure https://gist.github.com/julianjelfs/81e2dd976625f31574ff
I need to somehow flatten the result - but flatten is not quite what I want. Any advice?
@julianjelfs: a colleague of mine did it using the code above
@kongeor: yeah someone else mentioned that. But I'm not clear where exactly it slots into the code.
@julianjelfs: (mapcat identity (for ...))
?
@kongeor: seems to make sense. I'll give it a go (then I'll have to make my brain understand why it works). Thanks.
@teslanick: i didn’t see you get an answer to your Promise.all
in core.async
question. Here’s an in-progress example that should give you what you want: https://gist.github.com/bostonou/916ca98b56b694ff10fd
@teslanick: I don’t believe there’s a built-in fn that gives you everything Promise.all does
@kongeor: it works 👏
@julianjelfs: (apply concat (for …)))
would skip mapping everything through identity if you care
and the transducer version: (into [] cat (for …))
@crisptrutski: ah interesting - thanks.
mapcat is using apply concat under the hood
@crisptrutski: almost the same discussion going on in #C053AK3F9 Wondering what @stuartsierra has to say about mapcat
first [& [cheeky-optional-arg]]
, now concat? damn @stuarstierra hates my code 😉
ok, so he’s specifically talking to misunderstanding concat with repeated applications, not this case (phew)
Getting this error when I try build my cljs app with boot:
clojure.lang.Compiler$CompilerException: java.io.FileNotFoundException: Could not locate cljs/env__init.class or cljs/env.clj on classpath: , compiling:(cemerick/piggieback.clj:1:1)
java.io.FileNotFoundException: Could not locate cljs/env__init.class or cljs/env.clj on classpath: ...
So I created ~/src/cljs/env.clj
, but no luckare you missing a dependency for piggieback?
accessing an Om cursor within a go loop however the data returned is outdated. I'm guessing this has to do with how go blocks work?
@petrus: Maybe you’re using the latest clojurescript, which requires clojure 1.7*, and boot is using clojure 1.6
You’ll need to set the clojure version to 1.7 in boot.properties
ah, thank you. Yeah if I take out my clojure and cljs versioning I get this warning: WARNING: Different CLJS version via transitive dependency: 0.0-2816
boot show -p
will help debug version resolution
Thanks! all sorted. Pinned Clojure version in boot.properties and put in latest cljs dep in build.boot.
@mfikes's neato boostrapped ClojureScript REPL (Replete) hit Hacker News (I know, I know). Under the new submissions, feel free to represent!
@slipset @crisptrutski: Yes, my warnings about concat
were specifically about repeatedly calling it on the same object. The same warnings would apply to mapcat
as well, although it's less likely mapcat
would be used that way.
@bhauman: Nah, I was getting that behavior with an unmodified crashverse repo. It has ^:figwheel-always
on the crashverse.test-runner
namespace.
I tried adding it to the crashverse.core-test
namespace as well, but that didn't seem to help.
@zane: when you say new test vars you mean that when you define a new test, its not showing up?
@zane: what needs to happen is that the run-tests line needs to be recompiled not just rerun.
@bhauman: Would it be helpful to get a minimal test case for https://github.com/bhauman/lein-figwheel/issues/116 , or is that expected behavior?
has anyone else been having a problem where lein cljsbuild auto
won't compile .cljc files?
@gtrak thanks, that's definitely the issue I'm having, but I'm a little confused by what the solution is
so put [lein-cljsbuild 1.0.6] in the :dependencies section of project.clj in addition to in :plugins ? I'll try that
yea that didn't work. how do you change your cljsbuild dep to a snapshot version?
yeah when I do lein deps :tree cljsbuild doesn't even show up. I think that's because it's in the :plugins section of project.clj and not the :dependencies section? idk this stuff is really confusing.
it looks like this is the solution from that github issue page
"I explicitly excluded cljsbuild in the figwheel dependency and added cljsbuild 1.0.6 explicitly. Seems to be fine now."
@alwaysbcoding: so I should update figwheel to point to 1.0.6?
I think? haha I have no idea I'm a total noob, just trying to get this to work
@bhauman awesome! thanks
advanced compilation / modules question: I have a single-page Om app, I’m using bidi for routes. rendering the correct page is currently: (let [active-page page (condp = current-route :foo foo/foo :bar bar/bar …)] (om/build active-page)
I’m guessing that because I require all of the page components, and they all appear in the same render fn, I’m not going to get very good splitting from using cljs modules. Is that right? Anyone have a good solution?
I could replace the cond with a multimethod, but then I need to make sure namespaces don’t get compiled away
in clojure you need to 'require' a ns to load its multimethod impls, won't that still be the case in cljs, which means there will always be a dep from an entry point?
err, right, i mean the impl ns, in the case that it's separate from the defmulti-containing ns.
ok, so I think I have my modules correctly split up, but how do I use it in optimzations :none? when using modules, I can add to :module :entries. In :optimizations :none, modules aren’t supported, so then it seems that I have to explicitly require the two modules somewhere?
that seems to make it hard to use modules in production + :optimizations :none in development
a enhancement patch is welcome, but to be honest, I would just configure this type of thing via my webserver setup
for some reason, differences in how dev vs. prod load annoy me. I suspect it’s partly just lack of familiarity / being uncomfortable with the tools, and JS
it’s just more code to add to the compiler that I’m not particularly interested in working on myself
otherwise I see no issues with just handling this via lein-environ or whatever you like
(:module :foo) -> just returns main in :dev and returns the specific file in :prod or whatever