Fork me on GitHub
#babashka
<
2021-04-30
>
borkdude13:04:10

Most notable task changes: - Tasks now have :enter and :leave hook which can be set globally under :tasks and can be overridden per task - New current-task function which contains :name of the task and all of the other data of the task map from the bb.edn file - The above two things together can be used to log task names (at the start and/or end of a task) - New run function: (run 'my-task {:parallel true}) to invoke other tasks in serial, force parallel, do whatever you want.

🎉 8
borkdude13:04:10

I already kinda regret the run name, maybe I should have chosen run-task to not confuse it with run!?

wilkerlucio14:04:46

I think the run name is fine, there is the clojure run!, but in the babashka tasks context I think run makes sense

borkdude13:04:30

Anyway, naming is hard.

☝️ 8
borkdude13:04:38

Maybe a nice naming convention:

clean+dev (do (run 'clean)
              (run 'dev))
bb clean+dev

dharrigan13:04:14

it's not too late to change it 🙂

dharrigan13:04:07

Nothing is set in stone, esp with software 😉 You could accrete it, and notify deprecate the run name, then in a few releases, remove it completely.

borkdude13:04:24

Well, I chose it like this since the bb run subcommand is also called like this and this function accepts the same opts

borkdude13:04:17

But like with all names, I fret about those for weeks, change them, and sometimes and up reverting them to go back to the same name, so I take my regret with a grain of salt and I will listen to the feedback of users as well

borkdude13:04:23

Anyway, (shell "bb run --parallel ...") is now a thing of the past:

-dev {:depends [dev-cljs dev-less]}
         dev {:doc "Run app in dev mode, watch CLJS and LESS files for changes"
              :task (run '-dev {:parallel true})}

bherrmann17:04:49

There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors. -- Leon Bambrick

borkdude19:04:01

Small demo of how you can use :enter and :leave to print task names while they progress: https://github.com/clj-kondo/clj-kondo.lsp/blob/e906d4fc64f070311644529430b035bf9cbb7a0d/bb.edn#L7-L12

❤️ 3
👍 3