You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
release: prepare v0.6.0 — version bump, changelog, docs update (#93)
Bump version to 0.6.0, add changelog and release notes for component
framework (#90), kida readme CLI (#89), and sharp-edge fixes (#91, #92).
Update all doc version references from 0.5.0 to 0.6.0. Add documentation
for three new CLI commands (components, readme, extract), strict_undefined
and jinja2_compat_warnings config options, DefMetadata/DefParamInfo
introspection API, component call stack in errors, compile-time warnings,
and enhanced UndefinedError with kind field.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
-**`_Undefined.get()` API** — Fixed to match expected semantics. (#92)
30
+
31
+
### Changed
32
+
33
+
-**New warnings** — `PrecedenceWarning` (K-WARN-001) for `?? + |` without parens, `CoercionWarning` for silent filter type coercion, `MigrationWarning` (K-WARN-002) for `set` scoping with `jinja2_compat_warnings` flag. (#91)
34
+
-**`strict_undefined` mode** — Opt-in `Environment(strict_undefined=True)` for catching attribute typos. (#92)
35
+
-**`UndefinedError` context** — Attribute/key lookups now say "Undefined attribute/key" instead of "Undefined variable". (#92)
36
+
-**ErrorCode coverage** — Pushed from 21 to 73+ raise sites with full docs for all 38 ErrorCode values. (#91)
|`allow_calling`|`frozenset[str] \| None`|`None`| Set of type names whose instances may be called. `None` permits all callables. An empty `frozenset()` blocks all calls. |
74
-
|`max_output_size`|`int \| None`|`None`| Maximum render output length in characters. `None` means unlimited. |
74
+
|`max_output_size`|`int \| None`|`None`| Maximum render output length in characters. Raises `SecurityError` (K-SEC-005) when exceeded. `None` means unlimited. |
75
75
|`max_range`|`int`|`10000`| Maximum `range()` size allowed in templates. |
76
76
77
77
`SandboxPolicy` is a frozen dataclass -- construct a new instance for each configuration.
html = layout.render_with_blocks({"content": inner_html}, title="Page")
210
213
```
211
214
212
-
Each key in `block_overrides` names a block; the value is a pre-rendered HTML string.
215
+
Each key in `block_overrides` names a block; the value is a pre-rendered HTML string. Unknown block names now raise `TemplateRuntimeError` with did-you-mean suggestions.
> **Note**: Calling `render()` or `render_stream()` on a template where `is_async` is `True` raises `TemplateRuntimeError`. Use `render_stream_async()` instead.
304
363
@@ -499,7 +558,7 @@ Classify block metadata into framework roles: `"fragment"`, `"page_root"`, or `N
499
558
500
559
### TemplateError
501
560
502
-
Base class for all template errors.
561
+
Base class for all template errors. All Kida exceptions carry an `ErrorCode` accessible via `exc.code`.
503
562
504
563
### TemplateSyntaxError
505
564
@@ -514,9 +573,24 @@ except TemplateSyntaxError as e:
514
573
print(e)
515
574
```
516
575
576
+
### TemplateRuntimeError
577
+
578
+
Error during template rendering. Includes `component_stack` for errors inside `{% def %}` components:
0 commit comments