Fork me on GitHub
#biff
<
2022-09-13
>
Eric Dvorsak13:09:20

hello, is there a way to have the browser refresh when a page has been recompiled?

chromalchemy14:09:11

Would this work? https://livejs.com/ It worked for me with no config, just add to html header, on a simple local server (bb http-server task)

Eric Dvorsak14:09:55

I'm toying with biff default project, and it looks like it doesn't support HEAD requests for livejs

Eric Dvorsak14:09:45

I added ring middleware https://ring-clojure.github.io/ring/ring.middleware.head.html so head requests are passing now but it doesn't refresh

Jacob O'Bryant17:09:57

Interesting, I hadn't seen livejs before. I have an open issue to add this to biff: https://github.com/jacobobryant/biff/issues/117. I just haven't prioritized it because I'm used to manually refreshing 😅 . However if all it needs to work is to support head requests that shouldn't be too hard to get working. Doing it that way hadn't occurred to me. I would've expected adding ring.middleware.head to make it work. I'll try adding livejs + head middleware to the example project right now and see if I notice anything.

Eric Dvorsak18:09:50

@U7YNGKDHA I've tried that as well it doesn't update, I think one needs to ad the lastmodified header for it to work

Jacob O'Bryant18:09:21

yes--looks like live.js looks at that header or etag/content-length/content-type to see if any changed

Jacob O'Bryant18:09:36

I'm in the middle of adding some middleware to set the etag header which should make it work