Fork me on GitHub
#boot
<
2016-09-02
>
albert.lai04:09:14

hi all, I currently trying to use boot instead of leiningen. But cannot find out something like 'release-tasks' in leiningen which help to do release like 'taging', inc version...may I know what is the current workflow for releasing a project using boot?

seancorfield04:09:44

That's an open question at the moment but I believe a few folks have prototypes working for that.

seancorfield04:09:34

Part of the issue is that with Boot, how you maintain the version is basically up to you, since it's really just a parameter to a task.

seancorfield04:09:30

I think most people def the version into a variable, and use that in task options as needed to produce the JAR file.

seancorfield04:09:00

@albert.lai so whatever workflow you would adopt for versioning and releasing your library needs to work with however you decide to structure your build.boot file.

albert.lai08:09:46

Thanks for pointing the direction! Finally, notice that the push task had done most of the job.

uwo16:09:52

are :init-fns inside the cljs.edn file intentionally called on each reload (not just the initial load)?

uwo16:09:35

I’d like to only run the bootstrapping in my client’s main method once, not every time the client is hot reloaded. Is there anyway to do this besides not providing :init-fns and calling the main method directly in the index.html?

micha16:09:34

the namespaces will only be evaluated when they change

micha16:09:05

if you don't change any of the code referenced by :init-fns then they won't run

uwo17:09:23

right. so it’s the equivalent of :on-js-reload in figwheel

micha17:09:07

no, it generates a namespace

micha17:09:24

the :init-fns are top level expressions in that namespace

micha17:09:44

if that namespace doesn't change, there is no reason why it would run any code

uwo17:09:49

and is that why I don’t need to include the main method in my index.html?

micha17:09:51

because the namespace won't be reloaded

uwo17:09:09

well the main fn (in my core )namespace depends on every other namespace so it will always be run

micha17:09:19

as it must

micha17:09:31

if it depends on things that change it has to run

uwo17:09:57

right so there’s value to have a function that only runs on hotreload and a function that only runs the first time the app is loaded, because there’s not reason to run bootstrapping in the client everytime a change is made

uwo17:09:31

:init-fns in the since has two uses?

uwo17:09:48

there’s also :on-jsload in boot-reload, though i haven’t worked with that

micha17:09:03

that's the thing that is similar to the figwheel thing you mentioned

micha17:09:14

it just fires whenever code is reloaded

micha17:09:25

so you can do reactjs rerendering or whatever

uwo17:09:06

but, :init-fns also fire on every reload, which is the problematic part

micha17:09:26

nothing is firing though

micha17:09:40

the main namespace itself must be reloading

micha17:09:50

you can see in the console which namespaces it reloads

micha17:09:10

if a namespace reloads that means the js is evaluated

micha17:09:29

so whatever happens when js is evaluated will happen, of course

micha17:09:40

but it's not like an event is fring or anything

uwo17:09:49

hmm, maybe I’m being dense, but since a main namespace depends on the rest of the app, won’t it need to reload whenever its dependents do?

uwo17:09:13

right so effectively it behaves as on-js-reload

micha17:09:15

if it depends on everything then it will need to be reloaded when anything changes

micha17:09:22

sure in that specific case

micha17:09:26

where it depends on everything

micha17:09:49

that's an unusual case though

uwo17:09:13

gotcha. thanks for your time!

esp117:09:36

hi @micha i work w/@uwo - just wanted to point out another detail: what’s happening in our case is not only that the main ns is reloading, but that the boot/cljs/main34656.js ns that boot-cljs generates for us is also reloaded, and that contains a call to invoke the init-fn.

micha17:09:07

hm, yeah i may be confused

micha17:09:08

@uwo @esp1 if you could make a repro case i can look at it

chris_johnson17:09:35

question - if I have created a file in my project and I can see it in (boot (show “-f”)), should I expect that file to be in the classpath of the boot.user ns?

chris_johnson17:09:21

I’m trying to figure out what slf4j-factory is doing with a logback.xml file, so I put it in src/ and I just …want to be sure that it “should” be “on the classpath” when I call, say, (.get-logger (slf4j-factory) “root”)

micha17:09:52

@chris_johnson for the most part, yes

micha17:09:05

the way it works is that the files in the fileset have "roles"

micha17:09:21

there are two roles: input and output

micha17:09:33

files with the input role are on the classpath

micha17:09:56

files with the output role will be packaged up in artifacts, like jars, wars, whatever

micha17:09:23

the roles are not exclusive, so files can have either, both, or neither

micha17:09:00

there are 4 permutations, which correspond to :source-paths, :resource-paths, :asset-paths, and cache dirs

micha17:09:10

so the tl;dr of the above is that things in :source-paths and :resource-paths will be on the classpath and will show up in show -f

micha17:09:28

things in :asset-paths will show up in show -f but will not be on the classpath

micha17:09:11

but you can test if something is on the classpath by doing ( "logback.xml") for example

dominicm17:09:54

@micha https://github.com/juxt/edge/issues/18 I've reproduced the error on my girlfriend's laptop. 1st run gives an exception:

18:03:26.994 [clojure-agent-send-off-pool-0] INFO  edge.web-server - Started web-server on port 3000
      clojure.lang.ExceptionInfo: C:\Users\Name\.boot\cache\tmp\Users\Name\Downloads\edge-master\edge-master\czc\-rcsl8f\edge\system.clj: The process cannot access the file because it is being used by another process.

   data: {:file
          "C:\\Users\\NAME-~1\\AppData\\Local\\Temp\\boot.user1914636167023374358.clj",
          :line 31}
java.nio.file.FileSystemException: C:\Users\Name\.boot\cache\tmp\Users\Name\Downloads\edge-master\edge-master\czc\-rcsl8f\edge\system.clj: The process cannot access the file because it is being used by another process.

     file: "C:\\Users\\Name\\.boot\\cache\\tmp\\Users\\Name\\Downloads\\edge-master\\edge-master\\czc\\-rcsl8f\\edge\\system.clj"
   reason: "The process cannot access the file because it is being used by another process.\r\n"
 sun.nio.fs.WindowsException.translateToIOException
   sun.nio.fs.WindowsException.rethrowAsIOException
   sun.nio.fs.WindowsException.rethrowAsIOException
    sun.nio.fs.WindowsFileSystemProvider.implDelete
sun.nio.fs.AbstractFileSystemProvider.deleteIfExists
                                                ...
                                boot.file/hard-link    file.clj:  146
                          boot.tmpdir.TmpFileSet/fn  tmpdir.clj:  263
                     boot.tmpdir.TmpFileSet/commit!  tmpdir.clj:  249
                                  boot.core/commit!    core.clj:  451
                                boot.core/run-tasks    core.clj:  937
                                  boot.core/boot/fn    core.clj:  948
                clojure.core/binding-conveyor-fn/fn    core.clj: 1916
                                                ...
Deleting the cache, and re-running first gave me a 404, but second run worked with asset compilation. I've not yet been able to remove whatever boot built in that first run to make it work on subsequent runs, wondered if you might know the cause? I didn't see anything on the boot issue tracker that stuck out to me.

micha17:09:38

@dominicm bummer, i'll have a look

dominicm17:09:29

@micha I really appreciate that! Thanks.

anmonteiro22:09:33

how can I list the boot classpath?

anmonteiro22:09:44

boot show -d doesn’t seem like it’s giving me the correct deps

anmonteiro22:09:28

specifically I’m getting a ClojureScript 0.0-3308 pulled from god knows where

micha22:09:38

boot show -p is your friend there

micha22:09:48

also different pods may have different deps

micha22:09:00

you can use the show task and specify a specific pod

anmonteiro22:09:32

it must be coming from a pod

anmonteiro22:09:46

boot show -p doesn’t list that dep

micha22:09:36

you can add the argument to the show task to tell it to show things in a specific pod

micha22:09:43

instead of in the core pod, which is the default

anmonteiro22:09:30

the thing is I don’t know which pods really exist 🙂

anmonteiro22:09:04

the dep is getting pulled when I run boot-cljs-test

anmonteiro22:09:11

where do I go from here?

micha22:09:47

boot show --list-pods will list all the pods

micha22:09:33

so you can do boot cljs-test show --list-pods

micha22:09:40

or something like that

micha22:09:55

then you will see even pods that were created dynamically

anmonteiro22:09:22

@micha and how can I exclude that dep if it’s coming from a pod?

anmonteiro22:09:14

solved by adding doo as an explicit dep and adding the exclusion

anmonteiro22:09:17

thanks for help!