Hacker News new | past | comments | ask | show | jobs | submit login

I do this too. Using a hot reload server and having live reload in the browser as I'm changing tailwind classes, go files or templ files is a very efficient workflow.

Then for the actual build, everything is built and embedded in a single binary by conditionally using embed with build tags.

I think that live feedback development cycle is probably the most satisfying way to code something by oneself.

It did need quite a bit of messing around with tooling and my Makefiles are pretty big but at least I can reuse that in every new project.




Could you go into more details about the live reload (I use air + Echo), what hot reload server do you use for templ?

And what about "embed with build tags."? I embed every build now.


I use the "live reload with other tools" as it is described in the templ docs [0].

Basically, templ will start a live reload server in "proxy mode". Other tools can then request a reload by notifying the proxy. I started with the makefile described in the docs. But I also have tailwind in watch mode, esbuild builds and more.

[0]: https://templ.guide/commands-and-tools/live-reload-with-othe...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: