Fork me on GitHub
#boot
<
2016-10-28
>
ag00:10:05

Hey guys, trying to switch from lein to boot, I need to grab some stuff from npm, thinking about using degree9/boot-npm, the problem is I need to serve that stuff from ./resources/public. There's no way of telling npm to use ./resources/public/.node_modules and I couldn't find a way to serve static resources from outside of public with ring. lein-npm takes :root key and it works - you can tell to use any dir for node_modules root. What would you recommend me doing? I don't want to run npm and copy stuff every time I build things

hiredman00:10:06

to clarify, you want to publicly serve your .node_modules directory? the directory with all your node dependencies in it?

hiredman00:10:58

the ring resource middleware takes a "root" path

tianshu06:10:30

@mikebelanger Does fireplace support cljs completion now?

juhoteperi06:10:33

@doglooksgood If you have browser repl connection, yes.

tianshu06:10:16

sounds great!

lxsameer08:10:50

does boot-cljs have any conflict with boot-figwheel ?

juhoteperi08:10:58

@lxsameer What do you mean?

lxsameer08:10:38

@juhoteperi I mean , can i use figwheel when I'm using boot-cljs ?

juhoteperi08:10:00

boot-figwheel is separate from boot cljs stack and replaces boot-cljs & co

lxsameer08:10:11

so instead of boot-cljs i have to use boot-figwheel

juhoteperi08:10:33

Though I don't see why one would need to use Figwheel instead of Boot-cljs. It has a few more features but Boot-cljs is "idiomatic Boot task" while Boot-figwheel is quite hacky

lxsameer08:10:33

@juhoteperi boot-cljs is just for compiling to js right ? but figwheel has lots of cool features

juhoteperi08:10:34

@lxsameer Boot-cljs stack is nearly identical to Figwheel, pretty much the only feature it is missing is showing error context on the HUD

juhoteperi08:10:50

And configuration validation

lxsameer08:10:08

@juhoteperi so how to you check for possible errors

juhoteperi08:10:30

Boot-reload HUD will still display the errors and error location

lxsameer08:10:06

so what's the difference ?

juhoteperi08:10:03

Boot-reload HUD only shows the line and column numbers, Figwheel shows the source code for offending line (https://github.com/bhauman/lein-figwheel/blob/master/CHANGES.md#code-context-in-errors-and-warnings)

anmonteiro08:10:18

@lxsameer example of Figwheel's error msgs

anmonteiro08:10:46

boot-cljs will only show you the error msg and the line, not all that Elm-y stuff

lxsameer08:10:29

I'm a figwheel user who wants to migrate to boot

juhoteperi08:10:12

@lxsameer I recommend you try boot-cljs & boot-reload, it will provide similar live reload workflow

lxsameer08:10:26

cool thanks

juhoteperi08:10:28

You could try some existing example project first, for example https://github.com/Deraen/saapas

lxsameer08:10:20

sure thanks

lxsameer08:10:03

what does :scope key do when defining a dependency

juhoteperi09:10:41

Test scope is not included in uberjar and is not a transitive dependency

mitchelkuijpers12:10:47

btw @lxsameer, @richiardiandrea is looking into better integration of figwheel within boot (which does not use the target dir)

mikebelanger12:10:52

@upgradingdave Glad it helped! I just happened to have stumbled on that page the other day, and your problem gave me a deja-vu

mikebelanger12:10:40

@doglooksgood Judging from @juhoteperi's answer, I guess so! I just like Adam Bard's blog because he has lots of clearly-written tutorials. I'm not a vim user.

thedavidmeister13:10:48

hey, is there a way to run boot tasks in parallel?

thedavidmeister13:10:12

like, garden and cljs for example

martinklepsch13:10:32

@thedavidmeister there's some stuff in boot.parallel that @richiardiandrea has been working on. I think there might also be some docs around it somewhere, not sure where exactly though

thedavidmeister14:10:59

i mean, the readme is just a title 😛

micha14:10:54

haha yeah, the build.boot file is what you want to look at

micha14:10:07

it's very small and minimal

thedavidmeister14:10:00

cool, i’ll check it out tomorrow

thedavidmeister14:10:06

i’ll ping you if i get confused

richiardiandrea14:10:28

wow so many mentions today 😄 About boot-figwheel: I got the fileset part working, I am having a bit of trouble serving the (updated) files at the moment, it is coming along pretty well

richiardiandrea14:10:36

I was using boot-http for that, but it looks like the served files are always the ones you start the server with, probably figwheel does some magic for making sure it serves always the new version

richiardiandrea15:10:21

the nice thing is that I see the updated files in the boot's tmp folders so that part is working

anmonteiro15:10:46

@richiardiandrea I think the figwheel server attaches the updated CLJS files' MD5 to the filename to guarantee it serves the updated files

anmonteiro15:10:55

not sure though

richiardiandrea15:10:58

@anmonteiro that would explain what I am missing, so one solution can be to use figwheel's own server...I just wanted to overcome the limitation of using resources (for example I have my files in assets)

richiardiandrea15:10:11

thanks for the link, I'll inspect that

richiardiandrea15:10:54

I am very close to have it working

richiardiandrea15:10:23

and the fact that he is using resources maybe is linked exactly to this issue, not sure...`boot` has a nice watch task that could achieve the same thing, I'll need to figure this out

tolitius16:10:35

is there a list / collection of available boot templates? i.e. based on boot-new or lein ones that generate boot projects (i.e. like lambone / tenzing)?

juhoteperi17:10:42

New username \o/

dominicm18:10:21

What's this witchcraft?

hlship18:10:29

Hey, I’m starting to create a PR to update pretty to 0.1.30. Is there any magic, or just a matter of copying over sources?

ag18:10:18

so I was reading that discussion about boot-figwheel vs. cljs-boot/reload etc. I really like figwheel and have enormous respect for @bhauman and although using cljs-boot/serve/watch is pretty straightforward I’d rather keep using figweel. We’re migrating from lein to boot. Would it be wise to keep trying “hacky” way of preserving figwheel or it’s really like “swimming agains the current”?

richiardiandrea18:10:20

@ag I am trying to get out of the "hacky" way of doing things, we'll see if it pans out 😄

georgek19:10:16

My build.boot file only creates a project.jar file and never the project-named asset that its supposed to: (task-options! pom {:project 'ff-server :version "1.0.0"} jar {:main 'ff-server.handler} aot {:all true} repl {:init-ns 'ff-server.handler :eval '(set! print-length 20)}) (deftask build [] (comp (build-cljs) (aot) (pom) (uber) (jar)))

georgek19:10:30

I have no idea why.. any thoughts?

richiardiandrea19:10:53

@georgek how do you mean project-named asset? also, are you AOT compiling cljs sources?

georgek19:10:35

I mean, in this case, I’m expecting there to be an ff-server.jar file in the target directory and it only ever shows up as project.jar

georgek19:10:45

Um, nooooo on AOT-ing the cljs sources

georgek19:10:49

should I be?

richiardiandrea19:10:09

but I see the task (aot) there ah ah

richiardiandrea19:10:24

about the file, you need to append the (target) task

richiardiandrea19:10:35

in order to dump to ./target

georgek19:10:08

at the end ?

georgek19:10:24

I get this:

georgek19:10:25

Writing pom.xml and pom.properties... Adding uberjar entries... Merge conflict: not adding META-INF/LICENSE Writing project.jar... Writing target dir(s)... Implicit target dir is deprecated, please use the target task instead. Set BOOT_EMIT_TARGET=no to disable implicit target dir.

georgek19:10:32

(it still only writes project.jar)

richiardiandrea19:10:51

ah, basically it looks like two or more libs are trying to add META-INF/LICENSE to your artifact...

richiardiandrea19:10:33

there should be a way to set a merging strategy somewhere, lemme check

richiardiandrea20:10:12

@georgek do you have the requirement to produce a .js file in a jar I suppose?

richiardiandrea20:10:39

I mean only the .js file nothing else

georgek20:10:37

oh at this point the cljs stuff is incidental. I’m using nginx-clojure so my deployment strategy is not standard. What I’m trying to do is de-compose what’s now a monolithic project into one main lib and several other projects that pull it in via a local maven repo

georgek20:10:07

So, your suggesting that the LICENSE conflict is preventing the creation of that asset?

richiardiandrea20:10:34

because probably something like (sift :include #{#"\.js$"}) would just include the .js file and that's it

richiardiandrea20:10:50

after build-cljs

georgek20:10:11

kewl, I’ll check that out

mathpunk22:10:07

I'm trying to learn to use cider to develop an application that uses boot. It appears that if I just open a file in the project and jack in, it does not start the server that I get when I run boot dev from the command line.

mathpunk22:10:02

Mind you I'm not sure if this is the sensible way to be developing.

richiardiandrea22:10:01

@mathpunk cider calls boot using the cider-boot-parameters variable

mathpunk22:10:50

sweet, thank you

mathpunk22:10:01

er, wait --- that's exactly what I did

richiardiandrea22:10:46

lol ok so maybe there something else there

mathpunk22:10:50

i mean, probably not exactly, since it doesn't work 🙂

richiardiandrea22:10:43

step #2 is what I think you should verify

mathpunk22:10:06

mmm, yes.... now i'm realizing that's not general

mathpunk22:10:41

i misunderstood the customize-variable step

richiardiandrea22:10:49

let me know when it works, I use this wf daily

mathpunk22:10:38

do boot tasks compose from the left or the right? that is, when I see something like cider repl -s ...others... wait is repl last or first?

mathpunk22:10:54

er, I suppose it's, is cider last or first, now that i'm looking at how cider is defined in the "A Better Way"

richiardiandrea22:10:21

cider should be first

mathpunk22:10:32

I've got to learn more about how the runtime works... clojure code often makes sense but "where" it is is confusing as heck

richiardiandrea22:10:36

in Task Anatomy you can actually understand what is going on better I think

richiardiandrea22:10:57

the handlers are called sequentially starting from the first

mathpunk22:10:20

ah, nice. I thought I was kiiiiinda getting the fileset abstraction but, i think i'm still shaky on it

richiardiandrea22:10:34

the exception to the rule is when a task is launched in a future

richiardiandrea22:10:57

but that's not for now 😄

mathpunk22:10:58

status: staring at https://github.com/mathpunk/anansi/blob/master/build.boot which is cloned and modified from tenzing

mathpunk22:10:36

i'm not sure that all of these tasks made out of tasks actually save comprehension

mathpunk22:10:21

and i definitely don't know whether watch should happen before or after serve, or doesn't matter. I mean, if they're middleware, many tasks will be commutative right?

mathpunk22:10:56

or, maybe "dev" does enough that I just use that task in the cider modification

richiardiandrea22:10:04

so watch is a middleware, meaning...it returns a handler

richiardiandrea22:10:44

a middleware can be commutative or not, but depends on what it is doing I guess

mathpunk22:10:06

does watch /take/ a handler as well? or is it sorta on the edges of the system

richiardiandrea22:10:52

yep, well in case of watch, the its purpose is to call the handler chain on file system changes

richiardiandrea22:10:16

so I usually put it in front of everything

richiardiandrea22:10:38

and when it triggers, it calls the handlers after it

mathpunk22:10:58

hooray! I got the correct .dir-local.el on the first try. Thanks!

ag22:10:35

hey guys… sorry for a noob question: in lein I had (defproject {:profiles {:dev {:env ,,,,}}}). How do I set env values in boot? Trying different things, yet ring handler doesn’t seem to be picking up those.

richiardiandrea23:10:18

very cool way of building docker images