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

feat: add support for lazy generation #874

Merged
merged 2 commits into from
Aug 18, 2024
Merged

feat: add support for lazy generation #874

merged 2 commits into from
Aug 18, 2024

Conversation

Aerek-Yasa
Copy link
Contributor

The templ generate command generates .go files from .templ files. When the .go file is newer than the .templ file it indicates that the .templ has not been updated since the .go file was generated. This means that the .go file is still valid and does not need to be generated again. This ignores users manually editing the generated .go files, but there is usually not a good reason to do this.

This pull request contains a proposal to only generate the .go file if it is older than its source .templ file. This functionality was put behind a --lazy CLI flag to maintain backwards compatibility.

~Aerek

@a-h
Copy link
Owner

a-h commented Aug 17, 2024

This looks great. Sorry for the late attention, been on holiday. 😁

@a-h a-h merged commit 65c2618 into a-h:main Aug 18, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants