Kida 0.13.0

Streaming call/slot parity, stricter registration, and .kida loader listings

Released 2026-12-06.

Kida 0.13.0 is the checkpoint since 0.12.0 for template authors and framework adapters. Streaming an imported component call with a slot now matches a full render, filesystem listings include.kidatemplates, and invalid loaders, filters, and tests fail at registration withTypeError.

Fixed

Imported call and slot streaming

  • Streamed components stay strings — A template that{% call %}s an imported component and fills a{% slot %}now returns the same output from render_stream(), render_stream_async(), and render_block_stream_async() as from render(). Slot callbacks remain string builders when the surrounding template is lowered to a generator. (#305)
  • Named, nested, and direct streaming — The same parity holds for named and scoped slots, nested calls, empty slots, local components, inheritance, cache blocks, region-bearing templates, and direct async compilation.
  • Sandbox streaming —SandboxedEnvironmentfollows the same call and slot result. The sandbox remains defense in depth, not an isolation boundary.

Registration and cached warnings

  • Invalid registrations raise immediately — Configuring a loader, or registering a filter or test, checks the callable before any template renders. A missing method, a non-callable, or a signature that cannot accept the value Kida passes raisesTypeErrorand names what to change. Callables with no inspectable signature stay accepted, and rendering does not repeat the check. (#373)
  • Bytecode-cache warnings stay stable — Compiler and component-validation warnings keep their fields, order, and categories across cache hits. Malformed warning metadata is replaced. (#290)

Changed

Template discovery

  • .kida files are listed — FileSystemLoader.list_templates()includes .kida files alongside .html and .xml. The result is still a sorted, deduplicated list of relative POSIX paths across search paths. (#360)

Public names

  • Read-only template inspection —Template.source, Template.optimized_ast, and Template.environmentexpose the retained source, optimized tree, and compiling environment.kida checkand analysis read these properties. Rendering is unchanged.
  • Owned sentinel names —Undefined, MISSING, coverage accessors, STYLES, html.spaceless, and identity_gettextnow live on their owning modules. The previous private names still refer to the same objects.
  • Lexer tokens —Token and TokenType are defined in kida.tokensand remain exported fromkida.

Added

  • Multi-root inspection —kida check, kida components, and programmatic adapters can name explicit component roots, with deterministic ownership and K-TPL-005 when the configuration is wrong. (#292)
  • Opt-in component advice — Shape profiles, extraction candidates, and pass-through encapsulation findings stay opt-in and policy-neutral. They do not change rendering. (#283, #287, #288)
  • App-owned component example — A runnable local component shows typed controls, a scoped slot, and machine-readable inspection. (#279)

Security

  • Sandbox calls and streams share one policy — Callable trust and cumulative output limits apply on full, block, sync-stream, and async-stream renders. Applications that useSandboxedEnvironmentshould upgrade. (#304)

Upgrade Notes

  1. No template change is required for the streaming fix. Join render_stream() for an imported {% call %} / {% slot %}and compare it withrender().
  2. Code that assumedlist_templates() ignored .kidafiles should expect those paths in the sorted listing.
  3. A filter, test, or loader that cannot accept Kida's call now fails when it is registered, not on the first render. Fix the callable, or keep a signature Kida cannot inspect if that acceptance is intentional.
  4. Template.source, Template.optimized_ast, and Template.environmentare additive. Prefer them to private template attributes.
  5. Sandbox output limits and callable checks now apply to streamed renders. Review templates that previously streamed past a limit enforced only on render().