Clojurians
#boot
<
2017-02-22
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

qqq07:02:20

I have a boot config via serve / cljs-repl / cljs / watch / target working perfectly fine for client side development. Now, I need to write my server side, in python. Is there a way to have my python code serve the boot cljs/js files in such a way that: (1) the client code can make api calls relative to the python code (2) boot-serve runs on 3000, python server on port 8000, and the js side still reloads

qqq09:02:02

how am I supposed ot use "boot show -f" for debugging ?

geoffs10:02:51

@qqq show -f (or any other show really) can be dropped in at any point in a pipeline of tasks where you want more information about what the fileset is at that point.

qqq10:02:17

@geoffs: my confusion was not mapping "show -f" to (show :fileset true), which is what I need to use in the clj files

geoffs10:02:14

ah. yup. I’ve been tripped by that before

qqq10:02:56

here's a dumb question:

(aot :all ture ...) (show :fileset true)
(jar :project ...) (show :fileset true)
so this outputs the jar file (good) but also the class files (bad) is there a wya to say "generate for me the jar file -- and then ignore the old class files" ?

qqq11:02:45

is there no way in boot to say "drop these files from the fileset" ?

martinklepsch11:02:37

@qqq there’s the sift task and I think it has an option to filter out/remove files from the fileset

martinklepsch11:02:58

boot sift --help for details

qqq11:02:35

@martinklepsch : there's an optino to move based on regexp, but I don't see any to delete

qqq11:02:56

I ended up creating a "build" directory, and moving all the important ones into a specific directory (and leaving the rest in another useless directory)

martinklepsch11:02:36

Oh, right, it’s a bit convoluted: you’ll need to combine the :include and :invert options

qqq11:02:20

oh, you're saying I can just use :include to specify the ones I want

qqq11:02:22

and everything else will vanish?

martinklepsch11:02:48

by combining it with invert you should be able to effectively turn it into :remove

qqq13:02:29

when /src contains both server and client code, how do I setup boot? can I , with a single (comp (watch) ... ) generate both (aot) and (cljs) .... or do I need to weparate watch ?

martinklepsch13:02:18

you can do both in one watch cycle. Not sure why you’d want to do AOT during watch though?

qqq13:02:37

server side is GAE, so I need to genrate *.classes and move it into google's dev_appserver.sh

martinklepsch13:02:10

do you do that on every file change during dev? @qqq

micha14:02:39

:include will filter out any files that don't match

micha14:02:02

you can get exclude behavior by combining :include with :invert

micha14:02:10

:invert inverts the sense of the match

micha14:02:39

like the -v/--invert option to grep

qqq14:02:00

@martinklepsch : cpu cycles are basically free; what else would you use cpu cycles for?

martinklepsch14:02:47

@qqq if you consider the time those cycles need free as well :wink:

martinklepsch14:02:28

@qqq I’d always optimize for fast compile cycles, especially when doing frontend work it’s incredibly nice to have a tight feedback loop

qqq14:02:41

@martinklepsch : ah, you also do recompile every save -- but you're saying "only recompile client code", "don't recompile server code" on every save?

martinklepsch14:02:53

It sounded like you recompile server code that you’re not using right away, i.e. only upload to GAE later on… I’d avoid that and instead only recompile the code I need right in that moment.

martinklepsch14:02:20

could be I misunderstood but most dev setups I know don’t need AOT

mobileink15:02:30

you only need to gen-class servlet code once. boot aot watch ....

qqq22:02:26

does boot always use build.boot, or can we specify another file?

rads23:02:55

does anyone use a workaround for Boot with Cursive that does not involve custom code in the project itself? the existing solution requires a dependency in each repo: https://github.com/boot-clj/boot/wiki/For-Cursive-Users

rads23:02:17

thinking about implementing a boot wrapper so this can happen locally instead of in the repo

qqq23:02:38

I know that :resource-paths can be set via set-env! however, can I reset it in side a task?

cfleming23:02:40

@rads I don’t think there’s any way to do that, unfortunately. Boot is fundamentally not very amenable to static analysis. Even the eventual Cursive integration will probably require writing a task to return project information back to the IDE.

qqq23:02:03

okay, how do I use set-env from inside a task?

msuess23:02:20

I’m using ring-middleware-defaults to serve static assets from the public subdirectory of resources. I’m also using boot-reload. My main.cljs.edn file is locaded in resources/public. The initial load works fine, but reloading does not, because boot-reload prepends public to the url of the js files. Is there a way to tell boot-reload to not prepend public or to serve public files from a /public url path? I couldn’t find anything in the boot-reload or ring documentation. Thanks!

qqq23:02:22

inside a task, at the very start, I need to do a (set-env! :resource-paths) since for two different tasks, I need two diferent resource-paths

rads23:02:13

my concern is adding cursive-specific adapter code to every single repo

rads23:02:41

if there's a runtime hook that's fine as long as the hook is instead declared in the developer's local config rather than the project repo

rads23:02:43

just like lein profiles

rads23:02:28

that's why I mentioned a boot wrapper script because that code would live as a standalone thing instead of being duplicated as a dependency in every boot project

richiardiandrea23:02:22

^ maybe this sounds obvious, but the code could go in profile.boot

rads23:02:28

that sounds like what I need, thanks