This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-29
Channels
- # admin-announcements (8)
- # beginners (1)
- # boot (127)
- # cider (17)
- # cljs-dev (17)
- # clojure (69)
- # clojure-argentina (3)
- # clojure-australia (35)
- # clojure-japan (1)
- # clojurescript (66)
- # core-matrix (2)
- # cursive (33)
- # datascript (1)
- # emacs (2)
- # hoplon (17)
- # instaparse (1)
- # melbourne (1)
- # off-topic (13)
- # re-frame (7)
- # reagent (3)
Love how with the help of a few lines of Google Closure interop I can avoid the messy code of positioning tooltips so that they are anchored and always inside the viewport: https://gist.github.com/afhammad/25cd3fe6e05d870b6465
anyone know any theoretical reason why cljs.js/eval
wouldn’t work inside a web worker? i’m getting window is not defined
. you can’t access the DOM in a web worker, but i don’t see why the bootstrapped compiler would require it.
@sekao: you just need some way to refer to the global context, not sure what the best way to do that would be in a WebWorker
https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/core.cljs#L10128
I’m not actively using cljs.js/eval
at the moment so bug fixes will have to come from the community (and they have been)
is there a guide to building clojurescript for contributors? lein install
doesn’t work, and the “Developers” wiki page doesn’t seem to cover it
ah my bad, i even clicked that, but assumed it was just showing you how to format the patch
Anyone using ClojureScript to build parse.com-based webapps? (all I've found so far is https://github.com/travis/parseapp which looks defunct)
@dnolen: Does cljs.build.api/build
require that inputs
passed into it lists all the directories with Cljs sources or just the directory with main namespace?
Boot-cljs used to pass in only the directory with main ns but we noticed it caused some problems with test changes not being noticed by compiler.
On the other hand passing in all the directories causes other Boot specific challenges.
@juhoteperi: if you pass a input any .cljs/.cljc file will be included in the build
ClojureScript handles the case you’re talking about via :recompile-dependents true
by default
@dnolen: So if we list all the dirs, all the .cljs files will be compiled even if they are not required (transitively) by main ns?
@juhoteperi: yes that’s how it’s always worked
But until recently we have only passed in one dir and cljs has retrieved other sources from classpath
@dnolen: Right. The problem is that run-tests
doesn't see new vars added to a test namespace unless the test namespace is inside a directory passed to build
(i.e. when the test namespace is from classpath).
I have a example repo here: https://github.com/Deraen/problems/tree/cljs-changes-problem-2
The example uses just a macro which does the same what cljs.test uses to find the vars in a ns
@juhoteperi: I can’t think of any reason why it shouldn’t work but perhaps there’s some missing edge case. Marking a file for recompilation has nothing do with the classpath.
patch welcome for this - I’m not going to work on it myself - but I can point you in the right direction
@dnolen: Okay. I already debugged this quite a bit two weeks ago but didn't found the problem so hints would be great. I'll create a Jira ticket?
@juhoteperi: yes create ticket
preferred that you do not link to your example repo and instead just demonstrate the minimal thing that fails
1) compile everything in provided the ICompilable (`inputs` or whatever) 2) add all the dependencies (classpath stuff) compile those too.
so something is likely wrong with 2), things aren’t getting recompiled if they are on the classpath and change
but I just checked, everything should go through cljs.compiler/compile-file
even CLJS files from 2)
so no idea, but looking at cljs.compiler/compile-file
and cljs.compiler/requires-compilation?
are good places to start.
since you have a minimal example this another good use case for firing up a real debugger via Cursive to see why recompilation doesn’t get triggered
Yeah, I was thinking of checking with Cursive but wanted to hear first if this is a bug or if it was supposed to work this way.
Is it expected that {:optimizations :none} produces a bunch of .js files with a main one doing just a list of goog.require()s, while {:optimizations :whitespace} producing a single big .js file with everything inside?
@dottedmag: that's how Google Closure works
I see. It's pretty handy that :whitespace emits a single file, similar to :advanced.
What's the best choice for development/debugging then? I find it rather confusing that :none
and :advanced
output different file layouts.
Understand, but eh, it's so inconvenient to have different setups for development and release.
@dottedmag: it seems you haven’t gone through the Quick Start?
I went through it. There is a little issue though: Google Chrome does not allow inline scripts in extensions (which I'm trying to write), which makes :main
useless in this setup.
right browser extensions are the one of the few places where :whitespace
would be useful for dev
Uhm, looks like it works though. I was editing wrong project.clj
and wondering why nothing changes :)
@dottedmag: ok cool! I’ve never used it myself so I wasn’t sure