Fork me on GitHub
#babashka
<
2022-09-10
>
chromalchemy15:09:05

I am playing with BBin and loaded up watch task https://github.com/rads/watch and http-server https://github.com/babashka/http-server Are these sufficient to get a hiccup watch/reload setup going? Or do I need etaoin too like this?: https://github.com/babashka/book/blob/master/script/watch.clj What are current best practices?

🎉 1
chromalchemy15:09:21

I’m not sure how to add args to the watch command

borkdude15:09:39

@U09D96P9B What I'm doing with quickblog is add a javascript in the HTML which polls the server for changes

borkdude15:09:48

@U0CLCL6T0 could maybe comment on watch

chromalchemy15:09:01

Thanks. Ill try that, or maybe just use quickblog 😉

rads16:09:55

@U09D96P9B: The watch lib was inspired by https://eradman.com/entrproject/ so right now it's intended to be used to run shell commands when files change For practical purposes you probably want to just use entr right now. But you could do something like this to build static HTML if you had a build task you define in your bb.edn:

find . -iname '*.md' | watch bb build
That combined with http://livejs.com as @U04V15CAJ suggested could work I hope to add some more docs to watch soon so the intended use cases are more clear. I also want to add better support for using the watch function in Babashka so the CLI can be avoided altogether if desired

borkdude16:09:08

I would recommend just using this directly then: https://github.com/babashka/pod-babashka-fswatcher

rads16:09:40

Yeah, watch is just a wrapper around that library anyways

chromalchemy17:09:52

I used the Live.js script. Worked perfectly without any config, with the bb http-server task! Thanks!

borkdude20:09:29

Good to hear :)

borkdude15:09:05

There are some CSS things compatible with bb, but not those two I think. https://babashka.org/toolbox/

borkdude15:09:30

I've been considering looking into making instaparse work somehow

borkdude16:09:13

one problem I spotted in garden is that is also has some Java dependency

borkdude16:09:39

com.yahoo.platform.yui/yuicompressor :thinking_face: