Skip to content

Releases: a-h/templ

v0.3.819

02 Jan 11:39
e54517e
Compare
Choose a tag to compare

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 to v0.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)

v0.2.793

30 Oct 08:50
d9eefff
Compare
Choose a tag to compare

Changelog

  • d9eefff chore: bump version
  • f5e2469 chore: fix casing of files in test
  • 9b77eee chore: fix link in README.md (#931)
  • 30dff50 chore: normalize filenames
  • fb6a5c2 feat(lsp): add workspace folder initialization (#912)
  • ff29e12 feat: Add -fail flag to fmt (#923)
  • 88eed0f feat: promote rawgo from experiment to core feature (#905)
  • 3c65b43 feat: templ.Join method renders multiple components into a single component (#929)
  • bb5e41b fix: example flake syntax error (#959)
  • a4638e3 fix: parser: fix memory leak in goexpression.Func (fixes #916) (#935)

v0.2.778

08 Sep 09:08
e2511cd
Compare
Choose a tag to compare

Changelog

  • ad20522 chore: bump docs deps
  • e2511cd chore: bump version
  • e29dcde feat: context cancellation aborts rendering (#894)
  • c7c32aa feat: support running templ generate in a symlinked directory, fixes #858 (#901)
  • dcc8987 fix(lsp): update URI handling for non-templ files for references (#899)
  • c813195 fix: find gopls if not in path, fixes #895
  • 3ac3c9d fix: send SIGTERM signal to --cmd instead of SIGKILL (#687)

v0.2.771

23 Aug 09:10
aea3ae3
Compare
Choose a tag to compare

Changelog

  • ce14607 chore: bump Go to 1.22 in flake.nix
  • aea3ae3 chore: bump version [no ci]
  • 7279001 chore: fix linter errors
  • c24c8e4 chore: fix stale test
  • a033408 chore: switch to v0.8.4 of xc due to nix config error in xc
  • f29cc7a chore: update gofiber example with new rendering (#878)
  • ef4dde6 feat: add JSExpression to support passing arbitrary JS to script templates (#851)
  • a98204d feat: add templ info command (#840)
  • 65c2618 feat: add support for lazy generation (#874)
  • 889c833 fix: close SSE endpoint when browser page is reloaded
  • 4b2219c fix: duplicate import added when import path contains hyphens (#859) (#890)
  • 979cd97 fix: resolve templruntime imported and not used (#841), fixes #834
  • 211912f fix: support comments at end of raw go expressions (#871)
  • 15b3483 refactor: add CI checks to xc task list
  • 4c14ab0 refactor: allow for in flowing text if for statement not found (#777)
  • ae99146 refactor: improve void element parsing perf, fixes #886 and #857 (#887)

v0.2.747

04 Jul 22:03
9ae32f9
Compare
Choose a tag to compare

Changelog

  • 9ae32f9 chore: bump version
  • 37faae0 fix: off by one error in LSP that prevents autocomplete from functioning in some contexts

v0.2.742

04 Jul 19:19
bc6e65a
Compare
Choose a tag to compare

Changelog

  • 6c5eeb0 chore: bump docusaurus
  • 1c753f6 chore: bump version
  • 8b1f399 chore: update deps in examples
  • 5fb61a0 chore: update go modules in Nix setup
  • 26c1d79 feat: add support for gopls v0.16.x
  • bf98022 feat: update nixpkgs to release-24.05
  • 01d3361 fix: LSP CodeAction sometimes results in "error: column is beyond end of line" (#817)
  • 24520b8 fix: allow space after a period in go expressions (#811)
  • d3033c5 fix: don't pass ranges to gopls if outside of a known Go code region, fixes #801
  • bc6e65a fix: only call gopls if the source exists at the location, fixes #801

v0.2.731

27 Jun 12:27
dc3db0f
Compare
Choose a tag to compare

Changelog

  • efaf8e5 chore: add test to fmt cmd
  • dc3db0f chore: bump version
  • 2782591 chore: document formatting with vim (#769)
  • fa5a308 feat: add nonce to reload script (#784)
  • 69bfdb1 feat: organise go imports on format (#793)
  • 38d9eca feat: preserve indentation of multiline go string literals (#765)
  • 2dafa71 feat: query for the body tag rather than using string replacements (#766)
  • 599b54f feat: support []CSSClass in class expression (#768)
  • 94c1028 feat: templ.JSONScript: support setting type attribute
  • df80639 feat: use buffered IO to enable streaming responses, and implement flush component (#802)
  • 73474f6 fix(lsp): add missing nil check in CodeAction, fixes #771
  • aaa0049 fix: format single line raw go code (#767)
  • a0f5da5 fix: only write to file if content changed, fixes #794 (#797)
  • 19ffb1c fix: write logs to stderr instead of stdout, fixes #753 (#759)
  • 2a7278c refactor: add extra test
  • 9de401c refactor: add full range of script, css, html and text templates, supports #498
  • 1ea9027 refactor: add generate cmd test
  • 8d27ad1 refactor: add range to text, see #498

v0.2.707

25 May 08:24
0d42d67
Compare
Choose a tag to compare

Changelog

  • 0d42d67 chore: bump version
  • 85a7b8b feat: add JSONString and JSONScript functions, update docs, refer to templ script as legacy in docs (#745)
  • 190ddba feat: add WithNonce for CSP compatibility (#752)
  • e5633bb feat: add templ.Once function (#750)
  • 3009161 feat: log url on proxy error, increase retries (#756)
  • 1ecd566 fix: add script template support to scripts, fixes #754
  • b7a4eba fix: map go formatting errors to their locations in templ files (#737)
  • b93d02f fix: update push-tag to check local git is clean, and up to date
  • c1e734b refactor: add extra logging (#741)
  • 3d154ff refactor: add neater support for code components into templ.Once (#755)

v0.2.697

20 May 07:21
0c14a89
Compare
Choose a tag to compare

Changelog

  • 9f69219 [docs] add live reload example page (#709)
  • e3e98c0 chore(deps): bump golang.org/x/net from 0.19.0 to 0.23.0 (#722)
  • fe948cb chore: add .ignore file to skip IDE searching of external and generated files
  • 35e24ae chore: bump deps
  • aea0c80 chore: bump deps in echo example
  • 9d87403 chore: bump docusaurus version
  • c5507b8 chore: bump docusaurus version
  • e2ceaa3 chore: formatting
  • 0d80290 chore: go mod tidy
  • 6a9dbff chore: update echo example (#734)
  • 27fc6a3 docs(echo): set headers before calling WriteHeader (#729)
  • 210391f feat(lsp): map go code errors that aren't template expressions to clo… (#690)
  • 7d8287e feat(parser): support colons in element names (#723)
  • ef58c7a feat: add brotli support to proxy, warn on unsupported encoding (#695)
  • 750f91e feat: add experimental arbitrary Go code support (#713)
  • 41d5003 feat: normalise line breaks and path separators to Linux style, on Windows, fixes #539 (#696)
  • 6af8b3b feat: support build tags by copying template header over (#688)
  • ad707cb feat: support parsing (and converting) void elements, fixes #637 (#732)
  • fd2c772 feat: templ component snippet (#714)

v0.2.680

06 May 17:36
c6a2ac2
Compare
Choose a tag to compare

Changelog

  • e3e98c0 chore(deps): bump golang.org/x/net from 0.19.0 to 0.23.0 (#722)
  • 35e24ae chore: bump deps
  • aea0c80 chore: bump deps in echo example
  • c5507b8 chore: bump docusaurus version
  • c6a2ac2 chore: bump version number
  • 27fc6a3 docs(echo): set headers before calling WriteHeader (#729)
  • 210391f feat(lsp): map go code errors that aren't template expressions to clo… (#690)
  • ef58c7a feat: add brotli support to proxy, warn on unsupported encoding (#695)
  • 41d5003 feat: normalise line breaks and path separators to Linux style, on Windows, fixes #539 (#696)
  • 6af8b3b feat: support build tags by copying template header over (#688)
  • 702c106 fix: allow hot reload script to be re-evaluated, fixes #716
  • f300746 fix: allow slice type definitions in templ expressions (#670)
  • 89f216e fix: escape constant attribute Go strings (#725)
  • d120e33 fix: multi-byte character positions in LSP (fixes #482) (#712)
  • fe1f70e fix: prevent greedy parsing in raw element parser (#702)
  • 77ba285 refactor: remove legacy v1 to v2 migration feature (#697)