Fork me on GitHub
#boot
<
2016-11-02
>
chooie01:11:17

Hey guys, how am I supposed to call boot tasks from the REPL?

richiardiandrea01:11:14

@chooie try to use boot.core/boot or boot from the boot.user namespace, as in (boot (notify))

grounded_sage02:11:02

@micha I have two things I am completely stuck on. 1. I can't seem to figure out how to serve up image assets. 2. I'm not sure how to properly set up devcards. I think it's best in a separate folder so when I finally render the static site it's easy to ignore it. I'd like the option to serve it up with the normal dev task and or separate. I'm not 100% sure whats the best workflow. I've just thrown the code up on github so you can take a look. https://github.com/CommonCreative/vbn-redesign

grounded_sage02:11:44

Currently I have everything in the app.cljs and just use commenting to switch from dev to devcards etc

onetom04:11:10

@hlship could you make your REPL work from Cursive?

onetom04:11:18

im curious how much could i help with the snippets i shared because it works with static credentials but not with dynamic ones u can obtain on an ec2 instance

onetom05:11:01

as @danielcompton pointed out, there is a pull request which upgrades s3-beam to use AWS v4 signatures im gonna try to upgrade to that; i hope that solves the issue of using dynamic credentials https://github.com/martinklepsch/s3-beam/pull/36/files

pseud10:11:19

maybe a silly question but - I’d like to use 1.9.0-alpha14 in a new project, but “boot repl” invariably fails retrieving this from https://repo1.maven.org/maven2/ … Now I know that probably means the obvious, that this maven repo doesn’t carry that version of clojure. What I’m not having much luck turning up is how to actually get it, then. So far, I’ve also made a “boot.properties” file in the same project dir as “build.boot”, both mentioning clojure 1.9.0-alpha14 in hopes of not basing dependencies on the clojure version mentioned in my global boot.properties file

pseud10:11:32

(Digging around, it’s actually there — https://repo1.maven.org/maven2/org/clojure/clojure/1.9.0-alpha14/ .. Still, boot won’t fetch it, though.. shifting through boot docs)

drownbes11:11:00

Hi. I am trying to use boot-http but I cannot find how I can bind it to address different than localhost(e.g. 127.0.0.3). Can anybody help?

upgradingdave14:11:18

Hi @pseud - I just tested and if I set both boot properties and build.boot to point to 1.9.0-alpha14, it seems to work for me. Here’s my project in case it helps for reference: https://github.com/upgradingdave/cljs

pseud14:11:09

@upgradingdave hey 🙂 Yes I finally noticed that I made a simple error. Didn’t update because I didn’t want to spam the channel (more than I had). But thanks none the less 🙂

naomarik14:11:05

in the fileset, what are the dirs marked with :user nil?

Tim15:11:18

is boot similar to lein in that whenever you change the dependencies and/or resource-paths, you need to restart the repl?

micha15:11:56

@tmtwd no, the jars are added to the classpath dynamically

Tim15:11:08

oh wow, that is excellent

micha15:11:36

@naomarik the :user property indicates whether the contents of the directory originated in one of the user's project dirs

naomarik15:11:52

ah, how does something get in there then? checkouts?

micha15:11:11

@naomarik for example, dirs with :user true are :source-paths or :resource-paths or :asset-paths

micha15:11:42

internally boot needs to know this because the files in those temp dirs are synced asynchronously in real time

micha15:11:57

vs the other dirs in the fileset that are populated only as a result of tasks creating files

naomarik15:11:14

so the :user nil are for temp files?

micha15:11:22

keeping them separate facilitates a number of optimizations that improve perf

micha15:11:44

the ones with :user true are also temp dirs, the files in there are copied form the user's project dirs

naomarik15:11:45

but when I make a (tmp-dir!) it spawns off something else right?

naomarik15:11:50

that isn’t in the fileset

micha15:11:54

yes, that's correct

micha15:11:06

those temp dirs are just anonymous, boot-managed directories

micha15:11:32

you can add their contents to the fileset of course with (add-resource some-fileset your-temp-dir) for example

micha15:11:54

but dirs created with tmp-dir! are not really related to the fileset in any way

micha15:11:44

it's just useful to have a way to create an anonymous directory that will be cleaned up by boot's garbage collection when it's no longer referenced by a build

micha15:11:51

that's what tmp-dir! does

naomarik15:11:51

so in a new fileset, with all the :user nil things in it, how does something typically get put in one of those dirs?

micha15:11:41

so one of the interesting things about the boot environment is that you can, for example, remove directories from the classpath

micha15:11:11

like (set-env! :source-paths #(disj % "foo/bar"))

micha15:11:46

this is normally not possible because URLClassLoader does not allow the removal of URLs once they have been added

micha15:11:05

the reason why it works in boot is beacuse of those fileset dirs

Tim15:11:05

I’m trying to figure out the difference between :resource-paths , :source-paths and :asset-paths? I guess resource-paths could be files that your program needs at runtime, like html, or css , for example. :source-paths is source code .cljs files, that you need to compile the program, but you ultimately don’t need in a jar (since you’ll have .class files). Is this correct? and what would :asset-paths be used for? stuff like meta data?

micha15:11:24

when boot bootstraps itself it creates those fileset dirs

naomarik15:11:41

there’s a lot going on with your simple implementation, how long did it take you to plan this stuff out?

micha15:11:47

and those dirs are never removed from the classpath, and no new dirs are ever added to the classpath

micha15:11:58

so the URLs in the classloader are always those dirs

hlship15:11:01

@onetom: r.e. REPL, haven’t tried again; that stuff is “friday fun day” work.

micha15:11:22

when you add or remove :source-paths or whatever, it just changes the directories that will be synced to the internal fileset dirs

micha15:11:53

so while the URLs in the classloader are always the same, the files in those directories changes according to the :source-paths :resource-paths etc settings

micha15:11:07

does that make sense?

micha15:11:25

lol it took a long time to figure it all out

naomarik15:11:16

man it’s a phenomenal tool, just now taking the time to learn it properly so i’m not so dependent on examples

micha15:11:54

thanks, that's good to hear 🙂

micha15:11:30

@tmtwd there are all the details about :resource-paths, :source-paths, etc. here: https://github.com/boot-clj/boot/wiki/Filesets#definitions

Tim15:11:50

ok thanks!

micha15:11:56

@tmtwd in short the files in the fileset have "roles"

micha15:11:04

input and/or output

micha15:11:00

files can have one or both, or none

micha15:11:09

so there are 4 permutations

micha15:11:31

files with the input role can be obtained from a fileset via (output-files the-filesset)

micha15:11:43

same with (input-files fileset)

micha15:11:57

input files are on the classpath

micha15:11:13

output files will be packaged in jars, served from webservers, etc

micha15:11:36

so input files are files that could be input for a task that will build artifacts

micha15:11:45

like a compiler, for instance

micha15:11:59

output files are, for example, files that will end up packaged in a jar

micha15:11:38

so files in directories in :resource-paths, for example, have both input and output roles

micha15:11:56

files in directories in :source-paths have only input role, but not output role

micha15:11:11

files in dirs in :asset-paths have only output role, and not input role

micha15:11:02

in retrospect i think maybe using names like "source" and "resource" instead of just exposing the roles directly may have been a mistake

christianromney15:11:06

what's the right way to add a single file in the root of the project (e.g. Dockerfile) to the fileset as an asset

christianromney15:11:44

I suppose I could move it to a folder

christianromney15:11:49

but just curious 🙂

micha15:11:35

@christianromney there is the add-repo task

micha15:11:07

it's kind of an anomaly, it's in there because of docker stuff i was doing and somehow ended up in boot's built-in tasks

naomarik15:11:18

@micha what you mean by this: > in retrospect i think maybe using names like "source" and "resource" instead of just exposing the roles directly may have been a mistake?

naomarik15:11:25

aren’t “source” and “resource” the role names?

micha15:11:46

no, "source" means roles #{:input}

micha15:11:56

"resource" means roles #{:input :output}

naomarik15:11:05

ah so not naming them

micha15:11:06

"asset" means roles #{:output}

naomarik15:11:13

it makes sense to me though how you have it

naomarik15:11:27

just took some experimentation to grasp what’s going on

christianromney15:11:27

@micha thanks. i thought about using that but figured it'd be more work to sift out all the READMEs and cruft.

naomarik15:11:30

but i have no java background and very small clue about what was going on in the build process in both lein and boot up till recently

micha16:11:42

@naomarik yeah with boot we try to not hide things if we don't have to

naomarik16:11:16

having the role names though lets people know what happens when you do things like boot.core/add-resource

naomarik16:11:30

trying to justify your design decision 😜

micha16:11:39

haha yeah probably either way would be equally weird at first

lxsameer16:11:02

my build.boot contains an error, but boot traceback sucks, is there any way to force boot to show the problematic line number at least ?

naomarik16:11:01

the documentation is explains it well but could definitely benefit from some blog post tautology to help different minds

alandipert16:11:29

@lxsameer boot -b prints the script that's actually run

micha16:11:47

# with line numbers
boot -b task1 task2 |cat -n

christianromney16:11:29

hmm ok I have one more q for you @micha sorry bud. i'm also getting this issue: https://github.com/adzerk-oss/boot-beanstalk/issues/5 is there a known workaround?

micha16:11:39

@christianromney ah i haven't used boot-beanstalk for a while

micha16:11:03

it was a thin wrapper around lein beanstalk

micha16:11:23

but there was a lot of overhead with it, configuration was cumbersome

christianromney16:11:56

gotcha. i'm going to dig a little maybe i can contribute a patch if i locate the issue. seems like the issue is finding the :file in output-files

micha16:11:57

the eb tool is what we ended up using, and then we un-beanstalked

christianromney16:11:08

eb tool is super simple

micha16:11:26

yeah in the boot-beanstalk task there is a lot of hardcoded configuration

micha16:11:50

which was a pain sometimes

alandipert16:11:56

definitely will take a PR if you can fix it, but otherwise we should probably deprecate that thing as we no longer use it ourselves for anything

christianromney16:11:06

i don't mind adhering to the defaults for this little proj.

micha16:11:27

woudl you like to take the project over?

christianromney16:11:36

heheh easy now pard 😛

micha16:11:51

how about i just add you as an admin on the repo

micha16:11:58

and you can decide what you want to do

christianromney16:11:06

ok baby steps are cool

christianromney16:11:29

i'll still likely submit a PR for review before having greater audacity/ambition

christianromney16:11:27

you guys have really built a fantastic tool here btw. i know i said that yesterday, but srsly.

micha16:11:58

thanks 😄 it's awesome to hear that

lxsameer16:11:33

is it ok to ask boot-cljs related questions here ?

lxsameer16:11:44

does boot install the dependencies of a dependency automatically ?

alandipert16:11:01

@lxsameer yes, aka 'transitive dependencies'

alandipert16:11:12

@christianromney looks good - there was another PR with the exact fix

christianromney16:11:28

doh! I should have looked first

micha16:11:15

@lxsameer yes and yes 🙂

lxsameer16:11:45

my clojurescript build ids is:

lxsameer16:11:49

{:require [garm.core]
 :compiler-options {:asset-path           "js/compiled/out"
                    :output-to            "resources/public/js/compiled/app.js"
                    :output-dir           "resources/public/js/compiled/out"
                    :parallel-build       true
                    :source-map-timestamp true
                    :preloads             [devtools.preload]
                    :external-config      {:devtools/config {:features-to-install [:formatters :hints :async]}}}}

lxsameer16:11:58

and i'm using boot-cljs

lxsameer16:11:22

when i want to compile the clojurescripts files

lxsameer16:11:48

i get two warning and there are no compiled files , those warnings are:

lxsameer17:11:04

WARNING: Replacing ClojureScript compiler option :output-dir with automatically set value.
WARNING: Replacing ClojureScript compiler option :output-to with automatically set value.

lxsameer17:11:15

What's is wrong with my build id ?

micha17:11:00

@lxsameer boot-cljs does a lot of stuff to help you with configuration of the compiler

micha17:11:16

many of the options are tightly coupled to each other in hard to understand ways

micha17:11:36

i recommend not using any :compiler-options really

micha17:11:42

i never use them

micha17:11:57

boot-cljs will then be able to configure everything correctly

juhoteperi17:11:00

There are perfectly fine options, like parallel-build and preloads

juhoteperi17:11:16

But output-to and output-dir are automatically set by boot-cljs

juhoteperi17:11:14

Another reason besides helping the user, is that writing to resources directory would not make sense in Boot

naomarik17:11:00

@lxsameer you added the edn files that correspond to your builds?

lxsameer17:11:53

@micha, where is the default location for output-to/dir then ?

lxsameer17:11:11

@juhoteperi can you please explain a little more ?

lxsameer17:11:37

@naomarik yupe, the above content is for dev.cljs.edn

drownbes17:11:42

Is there any way to use github instead of clojars as a source boot dependency(like in npm)?

micha17:11:22

@drownbes not as such, but you can totally install things into your local maven repo

micha17:11:58

you can also have travis-ci automate building your jar and pushing to clojars if you like

micha17:11:14

whenver you push to github it could build and deploy a jar

micha17:11:10

having jars be the unit of dependency is pretty important for general toolchain sanity

micha17:11:27

jars with consistent artifact ids and versioning

drownbes17:11:43

So how I can replace for example boot-http package to its fork? And use it as dep to my project after that?

lxsameer17:11:00

@micha @juhoteperi @naomarik I removed the compiler options and compiled my cljs files. there is no error now, but i don't have any compiled js file in my source tree

micha17:11:28

you can fork it and deploy it under your own group id @drownbes

micha17:11:58

or you can modify it and deploy it to your local maven repo under the same group id and artifact id

micha17:11:13

depends if you want the fork in production

drownbes17:11:35

no. just for tests

micha17:11:36

you can clone the repo, then do boot build-jar to install it locally

micha17:11:41

you can modify the code etc

micha17:11:04

@drownbes that's how i would work on the dependency locally for testing

Tim17:11:28

if I wanted to incorporate a 3rd party (non-cljs) language like npm/react/babel or coffeescript or elm, would it be recommended and/or possible to incorporate that transpilation into boot or just leave it on its own with its own compilation/build tools etc. (webpack or whatever)?

drownbes17:11:15

but how can I use local jar in build.boot?

micha17:11:32

@drownbes you can just add the dependency

micha17:11:48

maven will search the local repo cache before going out to clojars

Tim17:11:50

(asking because I prefer to avoid node, where possible)

micha17:11:53

@drownbes well suppose you want to modify one of your dependencies

micha17:11:53

and use it in testing

micha17:11:09

is this pretty much what you are wanting to do?

drownbes17:11:05

I want to use fork of boot-http for experiments

micha17:11:23

ok so suppose you have the dependency [tailrecursion/boot-http "1.0.0"] depenency

micha17:11:38

that will be part of your build.boot :dependencies, right?

micha17:11:06

so you can clone the git repo for the project

micha17:11:12

and build it locally

drownbes17:11:20

i have done that

drownbes17:11:26

and i have jar file

micha17:11:28

in the boot-http repo dir you can do boot build-jar to build the jar and install it locally

micha17:11:36

in your local maven ~/.m2 cache

micha17:11:51

so you can go into the build.boot for boot-http and change the version for example

drownbes17:11:05

How i can install it to local maven cache?

micha18:11:53

there is the install task in boot to do tat

micha18:11:49

but in that specific project the build-jar task both builds the jar and installs it in your local ~/.m2 maven cache

micha18:11:03

so to clarify you can do the following

micha18:11:13

in the boot-http project, edit the build.boot file

micha18:11:26

change the +version+ var to something else

micha18:11:37

then do boot build-jar in the boot-http project dir

micha18:11:54

and look in your ~/.m2/repo/tailrecursion/boot-http directory

micha18:11:04

you will see your new version there

micha18:11:34

now, suppose you made your version like "6.6.6"

drownbes18:11:54

yes. I see it and it is working. thanks for your help.

micha18:11:00

in another project you can have :dependencies '[[tailrecursion/boot-http "6.6.6"]]

drownbes18:11:59

and why version surrounded with plus symbols? Is it some kind of convention?

micha18:11:16

the plus symbols are not significant in any way

micha18:11:02

it could mean "this var is a constant used to configure things"

drownbes18:11:25

same with surrounding with stars *?

micha18:11:01

the stars, or "earmuffs" as they say, are a convention used to denote dynamic vars

micha18:11:17

the clojure compiler will actually warn you if you make a var with earmuffs that isn't dynamic

micha18:11:30

but it's still only a convention

richiardiandrea18:11:05

by the way figwheel on my machine compiles in half the time (not a big source base but a lot of assets), I wonder what makes boot-cljs slower

richiardiandrea18:11:21

I need to dig into it

ag18:11:02

hey guys… I meant to ask this for sometime: what is this warning? should I try to fix it:

Warning: version conflict detected: org.clojure/clojure version changes from 1.2.0 to 1.8.0

alandipert18:11:29

it means that the underlying Maven machinery made a decision about which version of clojure to use that might cause you pain

alandipert18:11:52

this mostly happens when you depend on libraries that themselves depend on different versions of clojure

alandipert18:11:05

the best fix is to set the version of clj you want to use in your own project

alandipert18:11:24

e.g. bring it in explicitly as a dependency. it works because the way the Maven stuff works, the most direct dependencies "win"

ag20:11:12

@alandipert thanks for the thorough explanation. I have [org.clojure/clojure “1.8.0”] listed in .boot file

alandipert20:11:16

@ag np. if nothing is broken, i think the warning is informational

alandipert20:11:37

my guess is one of your dependencies wants to bring in clojure 1.2 but 1.8 is coming in instead because of your dep.

alandipert20:11:09

you could make the warning go away by specifying an :exclude to the dependency bringing in 1.2, which you can find by doing boot show -p

ag20:11:15

anyone who’s using Emacs. have you seen this? basically anytime I edit .boot file Emacs creates .#build.boot temp file and then boot doesn’t want to do anything in repl, until .boot file is saved

ag20:11:44

it would yell

java.io.FileNotFoundException: ./.#build.boot (No such file or directory)

raynes20:11:59

Man, emacs, those were the days. I'm developing on a surface book with vscode and an ubuntu subsystem.

raynes20:11:06

God save me

micha20:11:18

whoa and it's working ok?

raynes20:11:42

I can't install postgresql in the ubuntu subsystem due to broken system calls but otherwise it's fine.

raynes20:11:17

Windows 10 ain't half bad really

raynes20:11:31

Buggy but miles ahead of the past

ag21:11:18

I still would’ve used Emacs.

raynes21:11:52

I used to use Atom (I have a contributor patch!) but it's buggy as shit on windows

raynes21:11:07

vscode uses their shell, electron, and is made by microsoft so actually functions

raynes21:11:14

I use vim in bash

micha21:11:50

@ag do you have like :source-paths including .?

micha21:11:13

the error you are seeing is from a watcher that's watching the directory for changes

micha21:11:44

emacs creates and deletes files really fast while you're editing, which confuses the filesystem watchers

alandipert21:11:18

@ag you can also configure emacs to put the temp files elsewhere

micha21:11:21

so first i would recommend having emacs put swap files in a different place

micha21:11:36

haha what alan said

micha21:11:12

there is also a .bootignore file you can make to have it ignore those

micha21:11:16

one regex per line

ag21:11:29

@micha this is even before I start anything in the repl

ag21:11:56

.bootignore prob. good idea

micha21:11:00

like i don't have one of those

micha21:11:07

and it's not a problem for me

micha21:11:15

so i suspect there is something else going on with your setup

micha21:11:27

there shouldn't be anything watching the . directory

micha21:11:37

can you paste your build.boot file?

ag21:11:53

hmm… you know what… you’re right… something wrong in the task… even adding .#build.boot to .bootignore didn’t help

ag21:11:32

oh I think I found it

ag21:11:42

thanks a lot!

micha21:11:50

what was it?

ag21:11:26

(add-resource ( ".") :include #{#"^node_modules/"})

ag21:11:10

it’s turned out I actually need this… and

ag21:11:16

and how do I do it now?

micha21:11:05

hmm, @flyboarder has a boot task for npm stuff

micha21:11:18

@ag you might want to look at that and see what he does there

ag21:11:51

as far as I can see it just installs npm modules… that’s not the problem I still need to include ./node_modules as resource to “target"

flyboarder21:11:33

@ag my task moves the whole node modules folder to target 😉

ag21:11:58

@flyboarder oh… cool I didn’t know that

richiardiandrea21:11:03

@raynes yeah but we already had core.async 🙂

raynes21:11:23

I haven't seen cljs in 2 years

richiardiandrea21:11:27

or promesa, also very nice

richiardiandrea21:11:39

oh man, I am sorry 😄 😄 😄

raynes21:11:50

I like ES8

richiardiandrea21:11:07

there are improvements for sure

raynes21:11:32

My last two years has been scala, python, node (so much node), 4 SQL dialects, one Go project and fury

raynes21:11:28

Oh and gradle

flyboarder21:11:28

@ag the way it currently does it, it creates a temporary folder installs the modules to node_modules then adds that folder to the fileset as a resource so they are also moved to target

ag21:11:31

I don’t want to start a flamewar… but every time I need to review or look into .js code I feel like “why???”. Clojurescript is not just better. It just makes sense. I’ve tried almost every possible way to transpile into javascript (except elm and purescript).

ag21:11:14

and I am convinced that Clojurescript is just right

flyboarder21:11:26

@ag I also feel this way that's why I use cljs

flyboarder21:11:09

In my opinion cljs is so much closer to where programming should be

richiardiandrea21:11:21

same here, maybe only python for certain tasks can be worth it....but....well...no, still, I can use Clojure

raynes21:11:38

I don't like transpiling.

raynes21:11:11

I also like to appeal to the job market.

flyboarder21:11:21

@richiardiandrea: yeah just use boot and script it

ag21:11:42

@raynes what do you mean? EVERYONE transpiles to javascript today. only exception - if you’re a building a library

raynes21:11:57

No I don't, I'm using node latest.

richiardiandrea21:11:01

@raynes the market, it is definitely a good point

raynes21:11:23

Anyways, not hating on cljs

raynes21:11:29

Just need to check it out again!

richiardiandrea21:11:47

Clojure projects are out there, but not as many as Scala/Python/Node.js for sure

ag21:11:13

@raynes I made a balsy/insane move a few months ago. I quit my extremely well paid job (which also was 10 minutes away from home). And I found Clojure/script job the next day

ag21:11:42

because I couldn’t deal with js-land insanity anymore

raynes21:11:48

I'm looking for a job atm

raynes21:11:02

Factual's on the list, might get to do Clojure again there.

flyboarder21:11:29

I started my startup because of clojurescript, so much faster to develop and prototype

ag21:11:32

@raynes we’re in SF, we’re hiring… not remote though ;(

raynes21:11:42

I can't leave LA yet.

raynes21:11:21

I have a two bedroom apartment in West LA, too many friends to leave, and I love this city. And so much I'd have to relocate.

richiardiandrea21:11:31

Me too, I am looking for a short contract actually...for long term, I saw http://www.staples-sparx.com/ @raynes

ag21:11:32

yeah, we have people here who are not very convinced about remote culture

flyboarder21:11:08

@ag that's too bad, way more comfortable when you can work from home

raynes21:11:21

I'm literally insane from being stuck in my apartment half the time so I'm not sure I can even do a remote job without going utterly out of my mind. Already on the ledge

alandipert21:11:06

oh hey, i'm in LA now too

richiardiandrea21:11:27

ah ah, I work from home just fine 😄 Because I co-organize the Clojure meetup I guess and can every week talk geek there

richiardiandrea21:11:40

and of course here on #boot 🙂

alandipert22:11:14

@raynes what's the tech center of LA in your opinion?

alandipert22:11:29

last i looked all the startup type things were around santa monica

raynes22:11:23

Most of my targets are Santa Monica, Venice, and Marina Del Rey

raynes22:11:30

Silicon Beach

ag22:11:28

@raynes Anna Pawlicka was just tweeting that Walmart Labs are looking for Clojure people

ag22:11:42

not sure though if they consider remote

raynes22:11:48

You know I'm from Alabama right

raynes22:11:54

That's the only store

ag22:11:17

@flyboarder what’s the right way of calling npm task? tried (boot (comp (npm) (target)) - not seeing things in ./target

micha22:11:00

@ag you don't need the comp in there btw

micha22:11:18

(boot (npm) (target)) would do the same thing

micha22:11:27

but it doesn't hurt either

flyboarder22:11:47

@ag You also need to tell the npm task what to install

ag22:11:11

@flyboarder doesn’t it read package.json?

ag22:11:40

oh I think I found it

flyboarder22:11:44

So like (npm :install {:jquery "master"})

ag22:11:10

but it should read package.json if nothing passed into it… imo

flyboarder22:11:16

Or something like that, it doesn't read package.json because that's outside the fileset

flyboarder22:11:34

It will in the future, I didn't implement it yet

flyboarder22:11:06

But really you don't want those kinds of things in your root

flyboarder22:11:18

Again since they are outside the fileset

micha22:11:44

you could read package.json yourself in your build.boot and convert that to the EDN the npm task uses in the option

micha22:11:29

boot.core/json-parse

ag22:11:33

cool… thanks guys!

ag22:11:43

@flyboarder what’s the idea behind ./target/./package.json and ./target/package.json. any specific reason I should let them be there?

flyboarder22:11:06

No they are temporary files

flyboarder22:11:56

You can remove them but they are useful for debugging

ag22:11:03

what’s the best way of removing them? sorry I know I’m annoying, but you’re guys so nice, I am just too tempted 😉 tried this:

(deftask npm-install []
  (with-pre-wrap fileset
    (npm :install npm-deps)
    (-> fileset
      (rm (ls fileset (by-re [#"package\.json"])))))
something not quite right

micha22:11:18

@ag you want to use comp there 🙂

ag22:11:40

yeah, I just thought about that

ag22:11:50

still can’t get my head around

micha22:11:03

(deftask npm-install []
  (comp
    (npm :install npm-deps)
    (with-pre-wrap fileset
      (-> fileset ...))))

micha22:11:29

you want to run the npm task, then your own task directly after to do some kind of cleaning up or moving around of files, right?

ag22:11:04

ohh.. cool

micha22:11:14

you will also want to call commit! on the fileset at the end

ag22:11:24

jeez… I love boot!

micha22:11:08

the with-pre-wrap macro makes a task, which you can compose with the other task using comp

ag22:11:19

yeah… nice!

micha22:11:30

actually with-pre-wrap makes a task middleware, but you get the idea

ag22:11:59

you guys are so awesome.

adamkowalski22:11:34

Hey guys I’m hoping to get some feedback on this: https://hub.docker.com/r/adamkowalski/clojure/

flyboarder22:11:38

Then you can use the sift task to filter files from the fileset

adamkowalski22:11:49

I have tried to make a really light weight docker image that has clojure 1.9 and java 8

adamkowalski22:11:01

You can even get it on windows, all you need to is install docker

adamkowalski22:11:16

type: docker run -it —rm adamkowalski/clojure

adamkowalski22:11:22

and then when it loads type boot repl

adamkowalski22:11:27

it takes like 1 minute

adamkowalski22:11:19

with the OS (alpine linux) its still under 200mb

naomarik22:11:17

when would you use with-post-wrap? this level higher-higher order function middleware ideology is new to me and wondering an example where this particular form would be useful

naomarik22:11:07

as i understand it, this particular macro doesn’t affect a fileset through the middleware right?

micha22:11:45

right, if tasks were to modify the fileset on the "return path" of the pipeline that would introduce a lot of confusing behavior

micha22:11:11

so there is a convention to not do that

micha22:11:22

and the with-post-wrap macro will throw an exception

micha22:11:45

this type of middleware can be useful for side effects

naomarik22:11:58

so it’s more for tasks that examine the fileset and do something with it but don’t commit anything back to it?

micha22:11:05

like consider for example a task that will notify you of errors that happened elsewhere in the pipeline

micha22:11:14

exactly yes

micha22:11:36

like imagine tasks could add metadata to the fileset with info about errors or warnings etc

micha22:11:50

and another task could handle combined notifications

micha22:11:05

that task would probably use with-post-wrap to make sure it gets all the results

micha22:11:20

because all fileset modifications would be complete when its body runs

naomarik22:11:39

where does a task like that sit in the middleware fn comp? on the top?

micha22:11:59

it could be anywhere really

micha22:11:30

well if the pipeline has something like the watch task you would want to put it after that

micha22:11:38

because the watch task never returns

naomarik22:11:51

the middleware stuff is weird to visualize, i’ve been using it blindly for awhile and just recently saw how things really get evaluated and in what order

micha23:11:08

it's like a pipeline, that's how i imagine it

micha23:11:15

you connect the sections of pipe

micha23:11:31

and each task pushes the fileset through to the next task

micha23:11:55

and later collects the result and pushes it back up to the previous task

naomarik23:11:25

sounds like a forwards->backwards motion

micha23:11:14

task middleware would be the concentric shells

naomarik23:11:50

that’s a good pic. i had this notion completely grasped 2 days ago but haven’t hammered it into my head quite yet. will need to write some experiment examples for self

naomarik23:11:57

as a consumer of any middleware API it’s super obvious to see what’s going on, but to really understand what’s going on and being passed around as a newbie is strange

naomarik23:11:26

how the functions and values flow through each other

naomarik23:11:26

the forwards and backwards motion 😉

micha23:11:40

hm weird, i don't know why i put the "forward" motion on the bottom

micha23:11:50

maybe because i'm left handed

richiardiandrea23:11:17

Lol interesting choice yes 😉 this diagram is easier to understand than the one on the page I think, I wish I had this back in the days when I was studying it myself 😄 maybe you can label forward arrows with with-pre-wrap and back with with-post-wrap?

micha23:11:58

hm yeah, is there a shape that could be used to suggest calling a function?

micha23:11:23

the arrows going in and out somehow implying function call and result

richiardiandrea23:11:02

mmm and actually with-pre-wrap and with-post-wrap can both be in the same task

richiardiandrea23:11:29

for function call maybe a classic (fn) ?

richiardiandrea23:11:41

no dunno if it's clear

flyboarder23:11:25

Both return a fileset so you can comp them

richiardiandrea23:11:51

to visualize that though it's another story 😄

flyboarder23:11:20

Yeah that part doesn't explain it well enough because nowhere does it say I cannot manipulate the fileset when it's passed back up the pipeline

flyboarder23:11:57

You have to look at the post wrap code

ag23:11:17

I’ve gotten to the part where I need to migrate lein uberjar piece to boot. Can’t find anything related on the wiki.

richiardiandrea23:11:18

yeah the macro in this case hides a lot of what is going on, I usually never use with-post-wrap directly because of my brain limitation 🙂 I prefer to explicitely see the (next-handler...) call

richiardiandrea23:11:42

note that the last line is explicitely copying it to the target folder

richiardiandrea23:11:20

this can be something you might or might not want to do (you can delegate that decision to the command line)

naomarik23:11:52

my brain keeps telling me to go to hackernews or reddit when it feels stupid… need to stop that

naomarik23:11:31

what you using to make this micha?

micha23:11:38

lucid charts

micha23:11:42

awesome service

flyboarder23:11:50

Ms paint 😛

ag23:11:38

@micha in this diagram boot looks like a swiss army knife

micha23:11:00

i was thinking it looks like something from a biology class

micha23:11:06

"this is how babies are made"

micha23:11:24

there's the medulla oblongata

naomarik23:11:20

i need to make some more examples of this maybe using an animal creator middleware that just assocs animal parts into a map

naomarik23:11:17

it’s slightly difficult to conceptualize everything when too many abstractions are going around

micha23:11:50

yeah perhaps just ignore the with-* macros

naomarik23:11:26

the API is clear and can see how to use and write the tasks, but to make a similar system from scratch is what kinda knowledge i’m aiming for

naomarik23:11:30

i don’t think this will happen at 4 AM though

ag23:11:23

how do I change target for a specific task. e.g. I want to build .jar file into something other than ./target

naomarik23:11:58

set (target :dir #{”newdir”})