Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accidentally pushing temporary files when using templ generate --watch #961

Closed
simenandre opened this issue Oct 16, 2024 · 1 comment
Closed

Comments

@simenandre
Copy link

I am a big fan of the --watch mode with templ 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, since templ 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 the templ 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

(✓) os [ goos=darwin goarch=arm64 ]
(✓) go [ location=/opt/homebrew/bin/go version=go version go1.23.0 darwin/arm64 ]
(✓) gopls [ location=/Users/cobraz/go/bin/gopls version=golang.org/x/tools/gopls v0.16.2 ]
(✓) templ [ location=/Users/cobraz/go/bin/templ version=v0.2.778 ]
@joerdav
Copy link
Collaborator

joerdav commented Oct 16, 2024

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: #700

@joerdav joerdav closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants