Fork me on GitHub
#boot
<
2017-03-02
>
richiardiandrea00:03:01

Hello folks, is anybody using with-cp? Can you confirm it does not include :source-paths?

richiardiandrea00:03:34

summoning @micha ^ ๐Ÿ˜„

micha00:03:36

hmm one sec i will verify

richiardiandrea00:03:06

yeah it seems like it does not

richiardiandrea00:03:58

@micha do you think an option is preferrable so that we don't break the current "jars-in-jars-out" behavior?

micha00:03:43

what is the use case?

richiardiandrea00:03:07

I create cp for working at the repl

richiardiandrea00:03:19

and without src is a bit tough ๐Ÿ˜‰

pandeiro00:03:17

has anyone used mount with boot-reload in cljs? i'm hitting an issue where on reload, mount throws a very cryptic error: Uncaught could not start [#'myapp.ui.core/ui] due to TypeError: Cannot read property 'cljs$core$IFn$_invoke$arity$1' of null

pandeiro00:03:10

the stack trace in the dev console only points back to the defstate where that var is defined

pandeiro00:03:34

I think I'm just gonna ditch mount on the frontend; it's not doing much that a simple start, stop and reload set of functions couldn't do

tolitius03:03:50

@pandeiro here is an example of the boot project with mount and (reload): https://github.com/tolitius/hubble the error you posted is most likely not related to mount, and comes from the :start function of #'myapp.ui.core/ui

pandeiro04:03:11

@tolitius Thanks, you're right. I've tracked it down to how I'm trying to unregister re-frame handlers in my :stop function; something I was doing there prevented the :start function's registering of handlers

richiardiandrea04:03:37

Btw @tolitius is mount self-host compatible? (And how much work would it be to make it so?)

chooie05:03:58

Question for you guys: Is there a way to define private tasks like private functions? I have a number of tasks that always rely on calling another task but I canโ€™t figure out how to (comp) that task within the task definition. For example, this is what Iโ€™m currently doing:

(boot/deftask PRIVATE-reset-and-seed-database!
  [e environment VAL kw "Environment to use #{dev production}"]
  (fn [next-task]
    (fn [fileset]
      (reset-and-seed-database-fn environment)
      (next-task fileset))))

(boot/deftask reset-and-seed-database!
  [e environment VAL kw "Environment to use #{dev production}"]
  (comp
    (wordroot-util/data-readers)
    (PRIVATE-reset-and-seed-database!
      :environment environment)))
I want to just have something like:
(boot/deftask reset-and-seed-database!
  [e environment VAL kw "Environment to use #{dev production}โ€]
  (comp
    (wordroot-util/data-readers)
    (fn [next-task]
      (fn [fileset]
        (reset-and-seed-database-fn environment)
      (next-task fileset))))
Anything obvious Iโ€™m missing?

chooie05:03:44

Actually it looks like that latter case is working...

richiardiandrea05:03:47

You can try putting the meta ^:private between deftask and name

richiardiandrea05:03:31

If I remember correctly they won't show up in the help @chooie

kirill.salykin08:03:18

Hi all, if I start embedded jetty server - watch and sass tasks are not working

(deftask build-dev []
  (comp
   (watch)
   (sass)
   (aot :namespace '#{blog})
   (target)))

(deftask server []
  (build-dev)
  (blog/-main))
where -main starts Stuart Sierra component:
(defn -main [& args]
  (component/start (system)))
which is basically pedestal + datomic If I remove (blog/-main) from build-dev - watcher works, but no Jetty started. Otherwise - filewatcher not working (no sass compiled)

kirill.salykin08:03:01

PLease advice, how can I fix this?

pesterhazy08:03:14

server needs to be wrapped in comp

pesterhazy08:03:39

oh well not exactly

pesterhazy08:03:59

you should have a separate task that starts the server

pesterhazy08:03:53

something like this:

pesterhazy08:03:50

(deftask start-server [] (let [d (delay (blog/-main))] (with-pass-thru [_] @d)))

pesterhazy08:03:21

(deftask server [] (comp (build-dev) (server)))

pesterhazy08:03:58

the problem is that boot has two stages

kirill.salykin08:03:04

Can you please advice where I can more info on with-pass-thru? (shall i just google?)

pesterhazy08:03:27

the pipeline construction phase, and then the execution phase

pesterhazy08:03:02

the task constructor can do some work, like setting up resources

pesterhazy08:03:22

but this is only done once and before the tasks are actually executed

pesterhazy08:03:56

other than setting up resources, the constructor also returns a function, which is the actual workhorse of the task

pesterhazy08:03:25

with-pass-thru is just a thin wrapper around returning a fn (and keeping the fileset as it is)

pesterhazy08:03:24

this comes up a lot, I'll add a snippet to the wiki

kirill.salykin08:03:04

it would be helpful

tolitius13:03:17

@richiardiandrea, you mean whether it is .cljc and works in the same way on jvm and js?

richiardiandrea15:03:47

@tolitius no I was wondering whether it would run in JavaScript with no JVM, macros are positioned in a slightly different way for it to work: http://blog.fikesfarm.com/posts/2015-06-19-portable-macro-musing.html

richiardiandrea15:03:29

I will have a look as well

tolitius15:03:51

@richiardiandrea yes, it does work in JavaScript with no JVM. in cljs case, because :advanced compilation mode renames and shuffles all the nss, it works via a "derefable" state: https://github.com/tolitius/mount/blob/master/doc/clojurescript.md#managing-state-in-clojurescript (i.e. you @ a state when you need to use it)

richiardiandrea17:03:35

@tolitius that's great, gotta try with lumo then

tolitius17:03:29

@richiardiandrea this is exciting ๐Ÿ™‚ let me know how it goes

richiardiandrea17:03:16

@tolitius wait until I'll bug you with issues ๐Ÿ˜

qqq22:03:48

Is there a way to tell boot/cljs to put the "out" directory somewhere else? (like inside of target) -- it's screwing up helm-projectile-ag (which greps ALL FILES INSIDE PROJECT) ,, and unfortunately, "out" directory is inside project so it (1) SLOWS DOWN search and (2) returns USELESS JS

ag22:03:05

@qqq add it to .gitignore

qqq22:03:44

helm-projectile-ag still hits it

ag22:03:16

Add it to.agignore

qqq22:03:59

interesting; thanks!