Fork me on GitHub
#clojurescript
<
2015-12-05
>
cfleming00:12:44

@dnolen: I don’t think so - perhaps your REPL run config is set to compile before run? What sort of stuff ends up in there, copied resources and the like?

dnolen00:12:30

Yes. Doesn't happen when I manually run the scripts with java and classpath. Only via Cursive

cfleming01:12:49

@dnolen: Ok, check your run config, if it has Make as a before-run task, remove that and see if it helps.

dnolen02:12:12

@cfleming: it’s a REPL and yeah it has a make task, but no obvious way to remove it

dnolen02:12:31

ah I can just select and delete it

cfleming02:12:52

Those things have the most confusing UI, backed by the most confusing API

dnolen02:12:03

@cfleming: why is it the default to have that?

cfleming02:12:04

It’s really hard to stop them attaching where you don’t want them.

cfleming02:12:27

@dnolen: Because the Clojure run configs derive from the Java ones, I think

cfleming02:12:42

I should probably change that, but it means copying and pasting a bunch of code.

cfleming02:12:13

But it’s the source of some confusion, for sure.

dnolen02:12:44

wow REPL window’s open way faster now that I don’t have a completely useless step

dnolen02:12:55

but the real the problem was the completely cryptic errors

cfleming02:12:49

@dnolen: Ok, you’ve convinced me to fix that.

cfleming02:12:58

I hate those things.

dnolen02:12:25

the problem is really that it randomly copies things into target

dnolen02:12:30

and those pollute the classpath

marvotron02:12:49

if you can improve the UX for noobs when creating REPL run tasks that would be amazing simple_smile

cfleming02:12:55

I’m surprised by that, what sort of things got in there?

dnolen02:12:04

random om files, random compiled classes

marvotron02:12:05

im no stranger to java but that dialog doesnt fill me with joy

cfleming02:12:24

It should only copy resources, which come from somewhere on the classpath anyway.

cfleming02:12:48

@dnolen: Weird. Does this happen in one of your OSS projects I can test it on?

dnolen02:12:07

@cfleming: but really every single project

dnolen02:12:17

every single project randomly copies stuff there

cfleming02:12:24

Ok, I’ll check that out.

dnolen02:12:30

I mean I know it’s supposed to be resources

cfleming02:12:32

Are these non-lein projects?

dnolen02:12:40

but I can’t think of single time this is the desired behavior unless I’m building something

dnolen02:12:54

for applications or libraries when dev’ing with REPLs this behavior is a disaster

cfleming02:12:11

Yeah, the issue is that in a Java project you’re always building something, so I really shouldn’t extend the Java configs.

dnolen02:12:25

@cfleming: still thanks for the fix, I can now stop losing my mind simple_smile

cfleming02:12:12

@marvotron: Yeah, I’d like to make those run configs much easier by default.

cfleming02:12:47

The problem is I always put it off because the API behind it fills me with even less joy than the dialog.

cfleming02:12:12

Still, at least it generally doesn’t require a JTable

marvotron02:12:24

do those things still exist?

marvotron02:12:36

im glad my swing days are far behind me

cfleming02:12:10

You know, I actually don’t mind it that much, with occasional exceptions, and JTable is right up there.

marvotron02:12:32

well good luck. looking forward to a better run dialog in the future simple_smile

sveri10:12:33

Hi...is it correct when (type var) where var is a boolean returns: #<function Boolean() { [native code] }>?

martinklepsch10:12:59

@niwinz: is that with 2.5.0-SNAPSHOT or even with 2.4.2?

niwinz10:12:16

with 2.4.2

martinklepsch10:12:37

@niwinz: cool, then 2.5.0-SNAPSHOT should be even faster simple_smile

niwinz10:12:55

very nice! thanks!

sveri11:12:31

Hi, I just updated clojurescript and figwheel in my project and when loading my namespace I get this error: goog.require could not find: goog.testing.watchers Anyone knows what its about?

sveri11:12:38

hm, seems like a clean-build in figwheel solved it

iensu12:12:05

Hi! A newbie question: what is the least complicated way to setup tests in cljs? Don't matter if the output is displayed in the browser console or in the terminal. Preferably I'd like a solution that doesn't depend on phantom js. I only find examples using phantom, and while that works I feel I don't want to rely on having phantom installed.

jaen12:12:19

I've used this and seemed pretty cool - https://github.com/boot-cljs-test/testem-runner

jaen12:12:35

I'm not sure if there's a lein counterpart though, if you're using that

sveri12:12:24

I somehow am really concerned about the split that boot might cause between leiningen and boot and the availability of plugins / templates / boot scripts

iensu12:12:21

@jaen haven't tried boot yet, might give it a try. thanks!

jaen12:12:15

I think doo is quite popular for lein - https://github.com/bensu/doo - but can't tell you if it's good or bad, since I never used it.

iensu12:12:08

took a look at that as well, but haven't tried it yet. trying to get by with as few external dependencies as possible, but that seems quite hard simple_smile

bensu12:12:36

@jaen do you use boot-cljs-test?

bensu12:12:12

hey @iensu where would you want to run the tests?

iensu12:12:08

either in the browser or as running process in the terminal, either is fine

bensu12:12:54

I mean, in which js environment, the terminal is not a js environment.

bensu12:12:06

slimer, phantom, chrome, node, etc

iensu12:12:14

ah either node or chrome

bensu12:12:50

are you going to test dom related functions?

iensu12:12:02

nope, just the core logic for now

bensu12:12:23

ok, then node is your best candidate. do you have any async logic you want to test?

iensu12:12:47

not really

bensu12:12:59

then it is quite simple to set up without doo

bensu12:12:47

you'll find everything you need

bensu12:12:23

the one thing doo adds on top of that is the watch, compile, run-tests loop for faster feedback

iensu12:12:14

ah great, thanks! will give node a try first, and probably have a look at doo later in the project

bensu12:12:25

doo uses node.

jaen12:12:44

@bensu: I think boot-cljs-test is a different lib from testem-runner if I'm not mistaken.

bensu12:12:22

@jaen ahh I see. the names are quite unfortunate. boot-cljs-test is a boot library that wraps doo and boot-cljs-test/testem-runner is completely unrelated

jaen12:12:31

Oh, I see

iensu13:12:22

ok, just setup the tests using doo with node, works like a charm! thanks for all your help, and great tool @bensu.

bensu13:12:49

@iensu: no problem!

arronmabrey13:12:29

Anyone know what the most idiomatic clojure way to transfom a keyword :tl into a vector of keywords [:t :l] would be?

jaen13:12:27

(mapv (comp keyword str) (name :tl))?

arronmabrey13:12:53

@jaen that's perfect! Thanks! simple_smile

arronmabrey14:12:21

I was missing the name function for the keyword, I tried str but got back ":tl" vs "tl"

adamtrilling17:12:38

Is there a good way to use SASS with hot code reloading in ClojureScript? I've gotten spoiled by webpack :)

dnolen17:12:46

@adamtrilling: I haven’t tried it myself, but I’ve heard of people using middleman via jRuby

env18:12:36

@adamtrilling. with boot, i’ve successfully used boot-sass. tenzing is a lein template for generating a boot project. it includes a +sass option and works out of the box. https://github.com/martinklepsch/tenzing with lein and figwheel, i’ve successfully used the process described here, which uses stuartsierra/component and the native ruby process. looks like you could also use sassc or any other shell process. https://github.com/bhauman/lein-figwheel/wiki/SASS-watcher

jaen18:12:00

@adamtrilling: I've been using middleman as mentioned with - https://github.com/jgdavey/boot-middleman - it's a pretty good experience (now that the dependencies issues is fixed and you don't have to hack it).

adamtrilling18:12:30

Looks like I need to look into boot...i only know leinengen. Thanks everyone!

verma19:12:22

@adamtrilling: fwiw, I usually write scripts that watch sass/less stuff for me (using npm packages and what not), re-compiles then on changes, and then stages them to where lein-figwheel serves them

verma19:12:41

will paste some scripts

verma19:12:50

@adamtrilling: https://gist.github.com/verma/b025b15bcf2edc0b9538 I set this up a while back and it hasn’t failed me, if I were to do this again I’d probably go with what everyone’s suggesting here simple_smile

adamtrilling19:12:25

@verma that's sorta what I was looking to do at first. I wanted to set up cljsbuild to output to a file and have webpack watch that file and my stylesheets and build everything. But you miss out on a lot of cljs tooling when you do that

adamtrilling19:12:51

The boot-based stuff above looks a lot more idiomatic

jaen19:12:55

Actually I don't think you're missing out that way

jaen19:12:17

Both figwheel and boot-reload can reload files generated by external tools

jaen19:12:39

I for one use boot-middleman to just not have to have external dependencies

jaen19:12:44

Remember to npm install and so on

jaen19:12:56

Also, I used to do Ruby before, so middleman is quite natural to me.

juhoteperi19:12:17

@adamtrilling: For Lein you can use e.g. https://github.com/Deraen/lein-sass4clj (it is equivalent to boot-sass)

jaen19:12:53

But the downside is it's not the original SASS compiler, right?

jaen19:12:15

I remember sassc being fairly problematic when I tried to switch to it in Ruby, because it didn't support everything Ruby sass did.

jaen19:12:34

So I guess this probably isn't exactly 1:1 either.

jaen19:12:55

Ah yes, it's using libsass.

jaen19:12:09

So things like compass are out of question IIRC.

adamtrilling19:12:17

@juhoteperi that looks like what I was looking for...I'm surprised it didn't come up in my googling.

juhoteperi19:12:53

I'm not using Sass myself currently so I don't know the difference between libsass and ruby sass

juhoteperi19:12:21

But libsass looks like official project so I would think it works quite well

juhoteperi19:12:17

The benefit of using libsass is that the performance should be much better (it's really was when compared to less4j)

jaen19:12:27

It's kinda like with Ruby. Ruby sass is the official "spec", whatever it does is the right behaviour.

jaen19:12:34

Libsass doesn't track it 1:1 unfortunately.

jaen19:12:15

But if you're not doing things that don't work well with libsass then probably is worth it, due to the speed gain.

jaen19:12:50

You'd have to check the issues list and see if there's something show-stopping for you there.

jaen19:12:05

boot-middleman has the upside of being the Ruby sass so it's more-or-less working like if you were using it from Rails or something.

jaen19:12:08

That said, it's been about a year and a half since I tried that, it might be better now.

adamtrilling19:12:12

Yeah I will have to look into whether I actually need the Ruby SASS compiler. I already have a ruby dev environment on my machine so having Ruby dependencies doesn't really bother me

jaen19:12:07

You'd have to see if compass is working for example, last time I tried it didn't, because it used the ability of sass to be extended from Ruby, which libsass lacks.

jaen19:12:38

And you don't really get Ruby dependencies from using boot-middleman to be clear - it's using bundled jRuby and gems are put in .gems directory in your project.

jaen19:12:50

So no unneeded dependencies.

adamtrilling20:12:32

Interesting. I haven't used jRuby before and I didn't realize it was embeddable like that. I have used middleman in production though...it's pretty slick.

donmullen22:12:48

@jaen I believe libsass has finally reached parity - can’t seem to find the post.

jaen22:12:24

@donmullen: I don't think that would include Ruby extensions though. I mean, I prefer bourbon over compass, but it's a thing to keep in mind none the less.