Fork me on GitHub
#clojurescript
<
2015-08-29
>
dnolen00:08:54

@pandeiro: likely some kind of boot issue, lein has this problem too

pandeiro00:08:09

@dnolen: k... aot has very little advantage in boot anyway

pandeiro00:08:19

36s vs 40s for initial compile

dnolen01:08:09

@pandeiro: yeah, “aot” is really for cold incremental builds & REPLs.

afhammad14:08:25

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

sekao15:08:53

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.

dnolen15:08:04

@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

dnolen15:08:08

patch welcome

dnolen15:08:50

is the relevant line

dnolen15:08:08

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)

sekao15:08:42

thanks, i’ll check it out. maybe js/self will do the trick.

sekao16:08:51

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

dnolen16:08:42

@sekao: it’s not a bad idea to read all the Developers links simple_smile

sekao16:08:11

ah my bad, i even clicked that, but assumed it was just showing you how to format the patch

Josh18:08:00

Anyone using ClojureScript to build parse.com-based webapps? (all I've found so far is https://github.com/travis/parseapp which looks defunct)

Josh18:08:36

new to clj and in need of some good up-to-date examples

juhoteperi19:08:20

@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.

dnolen20:08:43

@juhoteperi: if you pass a input any .cljs/.cljc file will be included in the build

dnolen20:08:05

ClojureScript handles the case you’re talking about via :recompile-dependents true by default

dnolen20:08:23

if a test depends on the some ns that changed it will be recompiled

juhoteperi20:08:20

@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?

dnolen20:08:03

@juhoteperi: yes that’s how it’s always worked

dnolen20:08:18

inputs isn’t a new thing, it’s just sugar

juhoteperi20:08:48

But until recently we have only passed in one dir and cljs has retrieved other sources from classpath

dnolen20:08:54

again that’s how it always worked

dnolen20:08:55

nothing changed

dnolen20:08:23

if we weren’t fetching from the classpath dependencies wouldn’t work

juhoteperi20:08:25

@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).

juhoteperi20:08:28

The example uses just a macro which does the same what cljs.test uses to find the vars in a ns

dnolen20:08:55

@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.

dnolen20:08:12

patch welcome for this - I’m not going to work on it myself - but I can point you in the right direction

juhoteperi20:08:28

@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?

dnolen20:08:08

@juhoteperi: yes create ticket

dnolen20:08:56

preferred that you do not link to your example repo and instead just demonstrate the minimal thing that fails

dnolen20:08:24

the way that build works

dnolen20:08:26

1) compile everything in provided the ICompilable (`inputs` or whatever) 2) add all the dependencies (classpath stuff) compile those too.

dnolen20:08:19

so something is likely wrong with 2), things aren’t getting recompiled if they are on the classpath and change

dnolen20:08:12

ah k so something to think about

dnolen20:08:23

everything from 1) goes through cljs.compiler/compile-file

dnolen20:08:15

but that might not be the case for 2)

dnolen20:08:46

but I just checked, everything should go through cljs.compiler/compile-file even CLJS files from 2)

dnolen20:08:36

so no idea, but looking at cljs.compiler/compile-file and cljs.compiler/requires-compilation? are good places to start.

dnolen20:08:14

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

juhoteperi20:08:26

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.

dnolen20:08:14

definitely seems like a bug, I don’t see any reason why it shouldn’t work

dottedmag21:08:07

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?

dnolen22:08:26

@dottedmag: that's how Google Closure works

dottedmag22:08:23

I see. It's pretty handy that :whitespace emits a single file, similar to :advanced.

dnolen22:08:55

:whitespace isn’t used much these days - there’s not many popular use cases for it

dnolen22:08:57

pretty sure we don’t support source maps with :whitespace

dottedmag22:08:06

What's the best choice for development/debugging then? I find it rather confusing that :none and :advanced output different file layouts.

dnolen22:08:33

:none is for development, again that’s how Google Closure works

dottedmag22:08:16

Understand, but eh, it's so inconvenient to have different setups for development and release.

dnolen22:08:00

@dottedmag: it seems you haven’t gone through the Quick Start? simple_smile

dnolen22:08:09

all this stuff is covered there in great detail

dottedmag22:08:22

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.

dnolen22:08:13

right browser extensions are the one of the few places where :whitespace would be useful for dev

dnolen22:08:30

it’s come up before but no one has delivered patches for this use case

dottedmag22:08:11

Uhm, looks like it works though. I was editing wrong project.clj and wondering why nothing changes :)

dottedmag22:08:24

It == whitespace-level compilation and source maps.

dnolen22:08:32

@dottedmag: ok cool! I’ve never used it myself so I wasn’t sure