Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is pretty cool, but if you're rewriting resource names server side then you need some machinery to rewrite references to those resources. I see the example you linked shows the root HTML being generated server-side from a template so content hash names can be injected into the template. Looks reasonable. Not so great for dealing with things like `import` calls in javascript (for deferred loading of script modules), if those need to be rewritten as well.

Your JS bundler (if you use one!) might be effectively rewriting imports anyway so it can be convenient to do the content-hash-named-files rewrites in the same place. But not everyone wants to use a bundler for that.



Clace can be used to build hypermedia driven UI's, using Go templates and HTMX. https://clace.io/docs/develop/templates/#static-function gives the content hashed file name, the templates have to use that function. See https://github.com/claceio/apps/blob/f5566cea6061ec85ea59495... for an example, that game is running live at https://cowbull.co/

Clace can also run containers, where the UI is served by the container. For example, Streamlit/Gradio based apps. In that case, Clace acts like an app server and reverse proxy to the container, no file name rewrites are done.

Clace includes esbuild for being able to import npm packages as ES modules https://clace.io/docs/develop/javascript/. There is no support for any JS bundling.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: