Skip to content

Commit 82f31f5

Browse files
lbliiiclaude
andcommitted
release: v0.4.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0eb6844 commit 82f31f5

3 files changed

Lines changed: 102 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.4.0] - 2026-04-10
11+
12+
### Added
13+
14+
- **List comprehensions**`[expr for var in iterable if condition]` in template expressions with full parser, compiler, dependency tracking, and purity analysis integration. (#62)
15+
- **Error boundaries**`{% try %}...{% fallback %}...{% end %}` catches rendering errors and substitutes fallback content without aborting the page. Supports error binding, nesting, and streaming. (#61)
16+
- **Scoped slots**`{% slot let:name=expr %}` exposes data from components back to callers via `let:` bindings on `{% call %}`. (#61)
17+
- **`{% trans %}` / `{% pluralize %}` blocks** — Internationalization with variable interpolation, plural forms, and automatic escaping. (#61)
18+
- **Babel message extraction**`kida.babel.extract` entry point for `pybabel extract` compatibility. (#63)
19+
- **`kida i18n` CLI**`kida i18n extract` and `kida i18n analyze` commands for standalone message extraction and translation coverage analysis. (#63)
20+
- **i18n analysis module** — Tracks translatable strings, detects missing translations, integrates with dependency and purity analyzers. (#63)
21+
- **Partial evaluator phase 1** — Constant folding, filter inlining for pure built-in filters, assignment propagation, static loop unrolling, literal evaluation, and boolean short-circuit simplification. Opt-in via `Environment(partial_eval=True)`. (#64)
22+
- **Partial evaluator phase 2** — Extends optimization to conditional expressions, nested structures, string operations, comprehension folding, and cross-block constant propagation. (#65)
23+
- **`kida compile --optimize` CLI** — Inspect the optimized AST with before/after comparisons. (#64, #65)
24+
- **`@pure` decorator** — Mark custom filters for compile-time evaluation when inputs are static. (#64)
25+
26+
### Changed
27+
28+
- **Performance docs** — Updated to cover partial evaluation strategies and benchmarks.
29+
- **Compiler docs** — New sections on the optimization pipeline and `@pure` decorator.
30+
- **Configuration docs** — Documents `partial_eval` and related environment options.
31+
- **Custom filters docs** — Added `@pure` decorator usage and compile-time evaluation guide.
32+
1033
## [0.3.4] - 2026-04-09
1134

1235
### Added

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "kida-templates"
7-
version = "0.3.4"
7+
version = "0.4.0"
88
description = "Python template engine for HTML, terminal, and streaming — with framework integration"
99
readme = "README.md"
1010
requires-python = ">=3.14"

site/content/releases/0.4.0.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
title: Kida 0.4.0
3+
description: list comprehensions, error boundaries, i18n trans blocks, scoped slots, and a two-phase partial evaluator
4+
date: 2026-04-10
5+
draft: false
6+
lang: en
7+
tags: [release, changelog, expressions, i18n, error-handling, compiler, performance]
8+
keywords: [release, 0.4.0, list-comprehensions, error-boundaries, i18n, trans, scoped-slots, partial-evaluator, babel, extraction]
9+
---
10+
11+
# v0.4.0
12+
13+
**Released** 2026-04-10.
14+
15+
Kida 0.4.0 is the biggest feature release since the project's inception — list comprehensions,
16+
error boundaries, i18n with Babel extraction, scoped slots, and a two-phase partial evaluator
17+
that widens the compile-time optimization surface.
18+
19+
## Highlights
20+
21+
- **List comprehensions**`[x.name for x in users if x.active]` works natively in template expressions.
22+
- **Error boundaries**`{% boundary %}` blocks catch render errors and fall back to safe defaults without aborting the whole page.
23+
- **i18n `{% trans %}` blocks** — Full internationalization support with pluralization, variable interpolation, and Babel-compatible message extraction.
24+
- **Scoped slots** — Components can expose data back to the caller via `{% slot name expose x, y %}`.
25+
- **Two-phase partial evaluator** — Constant folding, dead branch elimination, and loop unrolling at compile time for measurable render speedups.
26+
27+
## Added
28+
29+
### Expressions
30+
31+
- **List comprehensions**`[expr for var in iterable if condition]` with full parser, compiler,
32+
analysis (dependency tracking, purity), and CLI integration. (#62)
33+
34+
### Template Control Flow
35+
36+
- **Error boundaries**`{% boundary %}...{% fallback %}...{% endboundary %}` catches exceptions
37+
during rendering and substitutes fallback content. Integrates with the environment's error handler. (#61)
38+
- **Scoped slots**`{% slot name expose x, y %}` lets parent components bind slot-exposed variables,
39+
enabling inversion-of-control patterns. (#61)
40+
41+
### Internationalization
42+
43+
- **`{% trans %}` / `{% pluralize %}` blocks** — Mark translatable strings with variable interpolation
44+
and plural forms. The compiler generates `gettext`/`ngettext` calls. (#61)
45+
- **Babel extraction**`kida.babel.extract` entry point lets `pybabel extract` pull translatable
46+
strings from Kida templates. (#63)
47+
- **`kida i18n` CLI**`kida i18n extract` and `kida i18n analyze` commands for standalone message
48+
extraction and translation coverage analysis. (#63)
49+
- **Analysis integration** — i18n analysis module tracks translatable strings, detects missing
50+
translations, and integrates with the dependency and purity analyzers. (#63)
51+
52+
### Compiler
53+
54+
- **Partial evaluator phase 1** — Constant folding, filter inlining for pure built-in filters,
55+
dead branch elimination, and loop unrolling for small static iterables. Configurable via
56+
`Environment(partial_eval=True)` with per-strategy controls. (#64)
57+
- **Partial evaluator phase 2** — Extends optimization to conditional expressions, nested structures,
58+
string operations, comprehension folding, and cross-block constant propagation. (#65)
59+
- **`kida compile --optimize` CLI** — Inspect the optimized AST and see before/after comparisons. (#64, #65)
60+
61+
## Changed
62+
63+
- **Performance docs** — Updated to cover partial evaluation strategies and benchmarks. (#64)
64+
- **Compiler docs** — New sections on the optimization pipeline and custom filter purity. (#64)
65+
- **Configuration docs** — Documents `partial_eval` and related environment options. (#64)
66+
67+
## Upgrade Notes
68+
69+
1. No breaking changes. Drop-in upgrade from 0.3.4.
70+
2. Partial evaluation is opt-in — enable with `Environment(partial_eval=True)`.
71+
3. i18n requires no new dependencies; Babel integration is optional.
72+
4. GitHub Action version tag updated to `@v0.4.0`.
73+
74+
## Links
75+
76+
- [PyPI](https://pypi.org/project/kida-templates/)
77+
- [GitHub](https://github.com/lbliii/kida)
78+
- [Full Changelog](https://github.com/lbliii/kida/blob/main/CHANGELOG.md)

0 commit comments

Comments
 (0)