This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-10
Channels
- # admin-announcements (7)
- # announcements (3)
- # avi (1)
- # beginners (222)
- # boot (184)
- # braid-chat (75)
- # business (7)
- # cljs-dev (3)
- # cljsrn (9)
- # clojars (17)
- # clojure (131)
- # clojure-dev (1)
- # clojure-portugal (4)
- # clojure-russia (39)
- # clojure-sg (1)
- # clojurescript (140)
- # community-development (563)
- # datomic (5)
- # editors (1)
- # emacs (3)
- # events (3)
- # leiningen (4)
- # off-topic (31)
- # om (84)
- # omnext (1)
- # slack-help (3)
- # yada (5)
@dnolen: if we get compile errors while using :parallel-builds
who/how should we tell?
@underplank: you can report them here, but you need to do a lot of work on your side first
all the namespaces look to be re-frame actually
errors should be simple to reproduce outside whatever thing you are actually working on
sure. I’ll checkout re-frame and see if thats runs on its own first.
@underplank: anecdotally I’ve been using :parallel-build
since I landed it 2 months ago
I only use Clojure contribs or things I wrote myself - these libraries have never emitted spurious warnings of any kind
so I would start with the assumption that something is wrong with a library you are using until you have good evidence otherwise
I was excited about it, so was going to give it a go It looks like it just cant find a var somewhere that it thinks it is. i’ll dig in a bit more.
all this said - I’m happy to get minimal cases - I’d like :parallel-build
to be reliable thing for more people
sure I understand
if that’s the case there’s nothing for ClojureScript to do - people will need to make sure their libs are organized properly for parallel builds
@underplank: so something to look for is any implicit dependencies
i.e. some namespace makes an assumption that compilation would be serial and does not declare a dependency
@underplank: there is also #C073DKH9P
@meow: yup, know about that, thanks.
@underplank: also the re-frame devs tried the parallel stuff when I landed it
ahh, so although all the namespaces are re-frame it might be some weird interaction with my code. That would make more sense. I would have expected that in the first place if it wasnt for all the namespaces pointing at re-frame.
you use a macro ns, but you don’t include the runtime stuff - because maybe expect some other ns to load it
right. thanks for the help!
Conjecture: If, for each of the runtime namespaces in a project, a fresh REPL can be started and that namespace successfully required, then that project can be successfully compiled with parallel builds enabled.
You can also imagine a corollary where, if all of a project's libs are safe for parallel builds, then you'd only need to test the project's namespaces.
I’m interested if we can find a counterexample to the contrapositive of the conjecture above (disproving it). In other words, wondering if this always holds true: If a project cannot be successfully compiled with parallel builds enabled then there exists a namespace that cannot be required in a fresh REPL.
@mfikes: that wouldn't hold true unless the parallel logic is 100% bug free. Given that we haven't formally-verified the logic and have done only a finite amount of testing, I wonder how confident we can be that there are zero bugs. 😀 Some number of nines I suspect. Btw, has the parallel logic at least been property-tested? (I imagine so given David's advocacy of such).
@mfikes: look out, you're starting to sound like a mathematician all logical like and sh*t
how do I configure which gets loaded into repl (Launching ClojureScript REPL for build: ...???)
But doing dev and test independently in separate consoles, with only dev being with figwheel - another option?
By the way there are lein-figwheel and a leiningen channels, so you might have better luck in one of them. Also you might have to wait a bit - most people not around at the moment.
@johanatan: Right. Just wondering if the the test is inherently invalid even if parallel logic is 100% bug free.
[ANN] I finally managed to cut a release of confetti, a small toolchain to make provisioning and deployment of static sites and single page apps on AWS/S3 a breeze: https://github.com/confetti-clj/confetti — feedback welcome!
is there a way to use .cljc
files in a project that provides backwards compatibility to older versions of clojure jvm?
pretty sure reader conditionals are only supported in 1.7 anyway
right. which i guess means it's one or the other?
As far as I know, you could use cljx, but it’s deprecated. I found what looks like a cool article and intro to the issue: http://danielcompton.net/2015/06/10/clojure-reader-conditionals-by-example
Do you absolutely need to support <=1.6?
well i don't, but i was hoping to offer a PR to another lib which currently does support back to 1.4
i think i'm going to have to spin off a compat library instead
ooh, yeah. that’s tricky
(i've implemented https://github.com/amalloy/ordered in cljs)
the implementations are already separate cljs files because cljs collection protocols basically don't line up at all with clj interfaces/protocols
but i was hoping to keep the tests cljc, to make maintenance easier
got all ready to open a PR and realized it broke the old versions completely
might be a good idea to fork the project. hanging on to 1.4 compat can be painful, and will hold the project back.
yeah. it would also be a tough sell for me to offer a PR that says, basically, you have to lose all backcompat.
it's one thing to lose 1.4. but if i were maintaining a project back to 1.5 or 1.6, i would probably reject a change requiring 1.7
thanks for confirming.
one thought - older users can just pin their dependency to the version of the lib prior to your PR
If you do that, you might get into a situation where you have to backport fixes for a while though. Which might be fine if it were your own project, but I agree with @eyelidlessness that it's a tough sell as a PR to somebody else's project.
the project isn't super active... maintaining a fork in this case doesn't feel crazy
they have the same tough decision to make if they want to move to reader conditionals and cljs and that work is already done by @eyelidlessness
yeah i guess there's no harm in offering
backcompat is always a choice. some choose it, others choose breaking changes. both are totally valid, depending on priorities
Looking for a quick sanity check… I’ve been programming in ClojureScript all day for months, but I’m now trying to follow the Quick Start just to get a minimal cljs.js example running: https://github.com/mhuebert/cljs.js-blank
just a single namespace+file with (ns blank.core (:require [cljs.js]))
As it builds, I see a sea of errors like WARNING: Use of undeclared Var cljs.core$macros/…
, and when I try to load the page, the first macro it tries to load throws cljs.core.defmacro is undefined
in Firefox or Uncaught TypeError: Cannot read property 'call' of undefined
in Chrome (on line 99 of core.cljc). Running Java 8, update 45. Am I missing something obvious?
Could someone take a quick look at this paste and tell me what I'm doing wrong?
@alex-eberts (vals e)
returns a list of all the values in a map
@alex-eberts: I think you should not use (vals ..) because it returns a seq
ops @mhuebert you won 😄
ah.. right, I'm getting a vector wrapped in a seq... I just want the vector.
thanks guys
you could also use a set as a function to test membership, e.g. ((set [:a :b]) target)
definitely more idiomatic and you save an =
and a %
😄
good point but I think that would fail for falsey values, no?
see the last note on https://clojuredocs.org/clojure.core/contains_q
in your use case should be a drop in replacement, basically being a function matching for =
with all the elements in the set
I think he was suggesting something like:
(defn seq-contains? [coll target]
"Returns true if coll contains target, nil otherwise"
(some #(target) coll))
hehe Andrea - I just realized that was you! Happy New Year!
Hey Alex, of course! I saw a buddy asking question and tried to help
Vancouver Clojure for the Win!
falsey values of target
?
(sorry don't understand were the falsey value can be, maybe because I am still Sunday sleeping :D)
@richiardiandrea: yeah if false
or nil
was the value you were testing, that’s what would be returned
from the examples on contains?:
The set-as-function shortcut will not work if you might be searching for a falsy value (false or nil). ; will not work (some #{false} [true false true]) ; = nil
oh ok, but it should be the least possible of your use case, trapped way before with some :pre
maybe
but good to know 😄
the data structure seems a bit weird, to get the name of an entity you’d need to do something like (first (keys entity))
the data structure will be a map of ids to vectors: {:e1 [:foo :bar :baz] :e2 [:foo :bar]} etc
it's the basis of a component entity system like chris granger did here: http://www.chris-granger.com/2012/12/11/anatomy-of-a-knockout/
would you not pass in just the val to your contains? function? eg. (when (contains-component? (:e2 entity-map)) …)
I'm passing contains-component? as a predicate to a filter function - it may be a bit of overkill but that's how it came out this morning
@mhuebert: The inability to require cljs.js
is really odd. I have a require on one of my blog posts and it is exhibiting the same. (http://blog.fikesfarm.com/posts/2015-09-05-runtime-macroexpand.html)
@alex-eberts: note https://clojuredocs.org/clojure.core/filter#example-542692cac026201cdc326b5f - when you filter a map the predicate function is passed the key and val separately as 2 args
so you could have (defn contains-component [target entity-name entity-vals] …)
and then (filter #(contains-component? :target %1 %2) entity-map)
for example
@mhuebert: that’s helpful - thanks!
:thumbsup:
@mfikes it’s super weird for me. And when I try to evaluate anything I get errors like WARNING: Use of undeclared Var cljs.user/fn at line 1
@mhuebert: If I simply start up a ClojureScript REPL, and then do (require ‘cljs.js)
I get the “sea”.
I found that there were other errors in the past. But that’s the immediate question I had, and why I looked for evidence that I had such a require in a blog post. 😕
@mfikes bit of a random question, have you ever run into problems with Uncaught Error: No method in multimethod 'cljs.compiler/emit*' for dispatch value:
errors? I get them when I use cljs/compile-str but not when I use cljs/eval[-str]. That’s what I was setting up this fresh project to troubleshoot .
I avoided them by using cljs/eval for the longest time, but now I’m trying to get better error messages via source maps, and haven’t figured out how to access the ‘maps while using eval
@mhuebert: If you clone the ClojureScript compiler tree, do script/build
, script/bootstrap
, script/noderepljs
, then you will be in a node REPL that can (require ‘cljs.js)
. This doesn’t explain why you can’t do it with cljs.jar
It probably involves digging into how the analysis cache is handled when doing things in that context.
In any case I put up a minimal example demonstrating an error handling problem with cljs/compile-str: https://github.com/mhuebert/mies-cljs.js
Ahh, I had just created it http://dev.clojure.org/jira/browse/CLJS-1541
Yeah, general guidance on self-host defects:
1. Start the title with the prefix Self-host:
2. Add the ‘bootstrap` label to the ticket
3. Make the ticket be Minor
priority.
@mhuebert: Edit permission in JIRA is a little more to get (may have to ask for it if you can’t change the ticket)
Ambly 0.7.0 cut, with support for tvOS: https://github.com/omcljs/ambly/releases/tag/0.7.0
Credit to @sherbondy for adding tvOS support!