This release has a couple of potentially breaking changes:
- templ now requires Go 1.23, due to an upstream dependency update (goquery). Usually, templ stays on the oldest supported version of Go (currently 1.22), but in this case, the fix upstream included a change to Go 1.23.
- A change to watch mode behaviour.
templ generate --watch
now triggers on changes to*.go
files in addition to*.templ
and other related templ files. This behaviour can be controlled by the new-watch-pattern <regexp>
argument, which defaults to(.+\.go$)|(.+\.templ$)|(.+_templ\.txt$)
. This is useful, because templ can now restart your web server if you make changes to your Go code. This change might break people's workflows, hence the bump tov0.3.xxx
.
templ generate --watch --cmd="go run ." --proxy="http://localhost:8080"
The biggest change in this release is probably #700 - which means that templ now generates the same code for dev mode and standard mode, using an environment variable to switch between. This should reduce issues where people accidentally commit dev mode code to their repos.
Important!
When you upgrade templ CLI, you will also need to upgrade templ in your project's go.mod
file by running go get -u github.com/a-h/templ
Changelog
- b919741 chore(docs): fix docs link
- b15d514 chore: bump docusaurus version to 3.6.3
- 1b58e02 chore: bump echo version in examples
- 65657de chore: bump nixpkgs version to use latest Go point release
- e54517e chore: bump version
- 2cc2884 chore: bump version of go tools, go compiler, and goquery (fixes CVE) (#1031)
- 3643c9b chore: storybook check int conversion bounds to remove lint warning
- 95a0cea chore: update generated code to return nil instead of generated value (#1025)
- b4a2274 chore: update ignore rules for text editor search to ignore go.sum and LLM help files by default
- 1d87e1a feat(docs): add llms.md (#1023)
- 4f2ce16 feat(lsp): add primitive document symbol support (#848)
- 98c4466 feat(storybook): add multiple story support for components (#971)
- a66a237 feat: generate same dev and prod code, fixes #700 (#1027)
- 3eaa56a feat: support latest version of Storybook (#1024)
- e16b2d8 feat: support unquoted HTML attributes, closes #963 (#1028)
- 6afd676 fix(breaking): trigger rebuild on changes to *.go files, fixes #646 (#1026)
- 9c8ad4d fix: increase hash size for autogenerated IDs to reduce collisions - fixes #978
- 9058914 fix: parser hangs when a bracket isn't closed (#1005) (#1029)
- c36a9e1 fix: remove repeated error messages (#1011) (#1017)
- 1f94c7b fix: stop double-processing generation in watch mode, now that the generation is identical
- 3d695f9 refactor: removed all references to github.com/a-h/pathvars (#999)