Fork me on GitHub
#boot
<
2016-02-17
>
jethroksy04:02:56

does boot do logging by default?

jethroksy04:02:45

all by boot tasks now have some form of logging 2016-02-17 12:03:47.005:INFO::main: Logging initialized @5097ms

jethroksy04:02:25

hmm doesn't occur with boot -B so I guess not

flyboarder04:02:26

@jethroksy: I think that is from some task utilizing the org.slf4j/slf4j lib

flyboarder04:02:45

I get those lines when I use monger for example

jethroksy04:02:58

I'm guessing it's tools.nrepl

jethroksy04:02:20

I went to search "log" in every other library I used and nothing turned up

flyboarder04:02:41

should be able to disable it with [org.slf4j/slf4j-nop "1.7.13" :scope "test"]

flyboarder04:02:53

i dont know if that will work tho

jethroksy04:02:58

I'll try that, thanks!

be905:02:03

does anybody use boot-midje here? I have no luck doing so. Hereโ€™s my build.boot: https://gist.github.com/be9/5a41d66d845385ba59b3 boot ci flunks with:

Starting pod...
Running tests...
             clojure.lang.ExceptionInfo: java.lang.Exception: No namespace: tms.t-user-profile found
    data: {:file
           "/var/folders/8c/ks3t17tx7x77ph5tv7r8ckf00000gn/T/boot.user1247824243219449554.clj",
           :line 31}
java.util.concurrent.ExecutionException: java.lang.Exception: No namespace: tms.t-user-profile found
                    java.lang.Exception: No namespace: tms.t-user-profile found
                             clojure.core/the-ns/invokeStatic                 core.clj: 4032
                            clojure.test/test-ns/invokeStatic                 test.clj:  742
                                         clojure.test/test-ns                 test.clj:  742
                                          clojure.core/map/fn                 core.clj: 2646
                                                          ...
                               clojure.core/next/invokeStatic                 core.clj:   64
                            clojure.core/reduce1/invokeStatic                 core.clj:  925
                            clojure.core/reduce1/invokeStatic                 core.clj:  915
                         clojure.core/merge-with/invokeStatic                 core.clj: 2950
                                      clojure.core/merge-with                 core.clj: 2942
                                                          ...
                              clojure.core/apply/invokeStatic                 core.clj:  648
                          clojure.test/run-tests/invokeStatic                 test.clj:  767
                                       clojure.test/run-tests                 test.clj:  767
What could it be? Of course, tests work fine in dev with (use 'midje.repl) and (autotest)

jethroksy06:02:36

@be9 could you do boot -vvv ci and check if the file tms.t-user-profile is in the fileset

be906:02:42

thanks, I will try that

jethroksy06:02:29

I'm thinking it's a test-paths , source-paths thing, but I don't use boot-midje so I don't know for sure

be910:02:44

@jethroksy: just tried to run boot -vvv ci on another box, getting

clojure.lang.ExceptionInfo: java.lang.AssertionError: Assert failed: The :source-paths, :resource-paths, and :asset-paths must not overlap.

be910:02:33

there's also registering test/clj [:create :modify :delete] line being printed, so it seems that tests are picked up

jethroksy11:02:22

@be9: could you inject (clojure.pprint/pprint (get-env)) after your set-env! to see if it indeed the case that there is overlap?

be912:02:34

@jethroksy: it seems there's none:

:source-paths #{"test/clj" "src/clj"},
 :resource-paths #{"html" "sql"},
 :asset-paths #{},

jethroksy12:02:30

@be9: maybe you have to conj test into source-paths as well

be913:02:13

now to another problem. I use boot-cljs, I have <script src="main.js"></script> in the index.html. Now the page path is "/this/deep" and main.js reference doesn't work (as it basically refers to /this/main.js). I tried to make it <script src="/main.js"></script>, but it still doesn't work because main.js has something like document.write('<script src="main.out/goog/base.js"></script>') inside, and that's again a relative path

be913:02:33

I handle different subpaths in the app by rendering the same exact index.html and figuring out routing on the client-side

jethroksy13:02:36

I'm not familiar with cljs

jethroksy13:02:46

I'm sure you could do something with the main.cljs.edn file

be913:02:06

I have this file, but I need to figure out how to change it simple_smile

be913:02:29

currently it's pretty minimal

{:require [tms.core]
 :init-fns [tms.core/main]
 :compiler-options {}}

micha13:02:55

@be9: can't you make a .cljs.edn file like this/deep/main.cljs.edn?

micha13:02:03

in your source paths

be913:02:19

uhm, I have paths like /users/378123/blah

micha13:02:26

then you can use relative paths like src="main.js" and stay sane

be913:02:41

so that's a user id in the path

micha13:02:50

i don't follow

micha13:02:07

can you pastebin your build.boot please?

micha13:02:31

ok right, so if you make a file src/cljs/this/deep/main.cljs.edn that would work, assuming that index.html is in say html/this/deep/index.html

micha13:02:39

relative to your project directory of course

micha13:02:19

that results in the compiled js going to this/deep/main.js relative to the docroot

micha13:02:31

and you can use sane relative paths in the html file to load the js

be914:02:31

ok, you don't get it. I wanted to mimic Rails URLs which contain user ids in them. Like /users/123/profile, etc. It all works on client side with HTML5 history (I use pushy library). But to make F5 key work on any page, I have to serve index.html everywhere.

micha14:02:37

oh sorry, i don't know about that

be914:02:41

So any path is a possible entrypoint to my app. It has worked well so far when I had only subpaths with level 1

micha14:02:43

i use uri fragments

micha14:02:52

eliminates all these issues

micha14:02:07

pushstate invvolves many hacks of which i know nothing

be914:02:17

you mean, #!/foo/bar ?

be914:02:21

well, I might just change everything to level 1 subpaths and use query params instead of ids in the path ..

be914:02:02

but it's strange that you can't just force cljs compiler into generating /main.out/.... paths

micha14:02:24

cosmetic path tweaking always causes problems, imo paths need to be form-follows-function

micha14:02:49

it seems strange because boot-cljs is really smart at figuring things out

micha14:02:00

but adjusting paths arbitrarily affects many different things

micha14:02:27

so boot-cljs makes a model for what a js application is

micha14:02:48

like how the JVM has the classpath model

micha14:02:59

boot-cljs provides such a model

micha14:02:20

within that model you don't need to know how source maps need to be configured, for example

micha14:02:31

source map configuration is tied to like 4 other options

micha14:02:48

change any one of them and you need to change the others in special ways

be914:02:23

I see, it's complicated

be914:02:58

my approach with referring /main.js would still work in production, where /main.js is just a js simple_smile

micha14:02:50

yeah if you use optimizations in gcl a lot of the issues go away

micha14:02:02

source maps still are an issue because of the way those are done

micha14:02:23

but most of the other issues involve relationship between the app and the output-dir

micha14:02:12

i think it's important to have a model for what a js app is

micha14:02:21

like what we have on the jvm

micha14:02:33

when you have a model you can start making tools to automate things

micha14:02:59

so like the js file location should be an implementation detail, imo

micha14:02:28

and the html file itself and the .cljs.edn file should be generated at the framework level

micha14:02:39

based on your cljs application

micha14:02:08

this way it's like a program instead of an unstructured document with js duct taped on

micha14:02:21

many problems solve themselves then

mobileink14:02:29

Morning folks. I'm happy to say that boot-gae (boot tasks for Google App Engine development with Clojure) seems to have reached the point of usability, at least for the simple app I'm using to develop it. I'm going to wait a few days before officially announcing it, but would love to get some feedback from boot experts in the meantime. You can find it at https://github.com/migae/boot-gae. The sample app is at https://github.com/migae/gae-hello-boot.

mobileink14:02:41

I'm sure my use of boot is far from optimal - I welcome any advice on how to do things better.

micha14:02:09

@mobileink: congratulations! ๐Ÿพ

mobileink14:02:40

Let's wait and see if it works for anybody but me. ๐Ÿ˜‰

micha14:02:05

maybe i'll sign up for gae today ๐Ÿ˜‰

mobileink14:02:02

Ah, forgot to mention: you don't need a gae account to use it!

mobileink14:02:55

At least the devserver. The SDK contains everything you need to run the devserver locally; you only need a gae account if you want to deploy to the web.

alandipert14:02:27

@mobileink: that looks great! i'l definitely try it out. the documentation looks really good as well, congrats

mobileink14:02:24

Great, let me know how it goes. Tried to eliminate dependencies on my local setup but you never know.

mobileink14:02:56

I've been wanting something like this for years - appengine-magic/leiningen, gradle-appengine-plugin/clojuresque - way too complicated and inflexible. With boot the user is totally in control! Yay.

micha14:02:44

that's what we like to hear!

micha14:02:00

programmers gots to program

curtosis17:02:19

anyone have a pointer to a project with a good breadth of datomic boot tasks? thinking dev tasks here, like transact-schema, db tests, etc.

dave20:02:40

we found a way to write bookmarklets in clojurescript, if anyone's interested in doing such a crazy thing: https://github.com/adzerk-oss/boot-bookmarklet

laforge4923:02:36

shifty sift - I want to move file dcells.js, which is getting placed in the top-level directory of the zip file to the resources directory in the jar file. My sift task doesn't seem to do anything: (deftask dev "Build project for development." [] (comp (cljs :optimizations :simple) (sift :to-resource #{#"^dcells.js$"}) (build-jar) (target)))

richiardiandrea23:02:18

I played a bit yesterday with this, have you tried to show -f after you sift?

richiardiandrea23:02:50

where exactly is dcells.js? if it is not in :source-paths or :resource-paths or :asset you have to add it manually

richiardiandrea23:02:24

Personally I do like the following @laforge49:

(deftask version-file
  "A task that includes the version.properties file in the fileset."
  []
  (boot.util/info "Add version.properties...\n")
  (with-pre-wrap [fileset]
    (-> fileset
        (add-resource (java.io.File. ".") :include #{#"^version\.properties$"})
        commit!)))

laforge4923:02:19

@richiardiandrea: dcells.js is the output of the cljs task. It is a js script for a web-worker.

richiardiandrea23:02:02

ah it's the regex, because I think boot passes the path

micha23:02:10

the :to-resource thing does add-resource

richiardiandrea23:02:11

you cannot start with ^

micha23:02:16

it doesn't change the path at all

micha23:02:48

:to-resource doesn't have anything to do wiht the directory it will be in in the jar file

micha23:02:03

you want to use :move

richiardiandrea23:02:21

so basically dcelss.js is already a resource when it comes to sift right?

richiardiandrea23:02:36

I mean already an output, better

micha23:02:23

(sift :move {#"^(dcells\.js)$" "resources/$1"})

richiardiandrea23:02:24

ah ok, I completely misunderstood the intent there ๐Ÿ˜„

micha23:02:57

i might be confused too simple_smile