Closed simenandre closed 1 month ago
Hey! Thanks for the report.
We have a bit of a conversation ongoing at the moment on this with some PoCs floating around too.
The first plan of attack is to make watch mode generated go files the same as production generated go files. Then the txt files can just be git ignored.
This is being tracked here: https://github.com/a-h/templ/issues/700
I am a big fan of the
--watch
mode withtempl generate
, it supports that flow we really are looking for at Padeia. The flow also typically consist of pushing small changes (as a PR), however, sincetempl generate --watch
generates_templ.txt
and a different_templ.go
file; they are often pushed to a branch (or even to a server, from time to time).I am not sure how to fix this yet, I have been thinking about maybe we can search for
_templ.txt
files in a git hook or something? Not sure. Current fix is to let the team know to stop thetempl generate --watch
command before pushing to git.However, I thought I'd share the problem we're facing as there might be others having the same issues.
templ info
output