v0.5.0 (2026-09-09)
Added
Define named component variants with
PreviewExtension, customize variant and page layouts with templates or components, browse previews withcitry --app module:app ext run preview serve, and capture PNGs with the extension'srendercommand. Preview endpoints exist only in servers started by these commands.Components, including
LibraryComponentdefinitions, can declaresimple = Trueto render presentation templates without an independent instance or component hooks, keeping data callbacks live; incompatible declarations and calls raise errors. See the simple component guide.RenderFramegains anis_transparent_rootfield defaulting toFalse, identifying a transparent component's whole output separately from caller-owned interiors.RenderFrame.from_context()andCitryRenderaccept the same keyword.
Changed
simpleis a reserved, immutable boolean declaration onComponentandLibraryComponent, including when set toFalse. Rename existing unrelated class attributes with this name.- Direct
ElementAttrsNode.render()calls can return plainstrwhere they previously returnedMarkup. Theformat_attrs()helper still returnsMarkup. - Persisted render-cache entries from earlier versions become cache misses and are regenerated when used after upgrading.
- Repeated component renders do less ownership bookkeeping, attribute normalization and text traversal. Core builds with native ownership storage further improve larger component trees. Renders without nested component calls avoid native storage setup.
Fixed
- Dynamic HTML tags forwarded through constant component inputs render correctly from templates, including on repeated renders (#107).
- Components rendered through nested standalone templates, loops, and layout slots now initialize their JavaScript and
js_data()state correctly. - Transparent components with nested template blocks and slot fills emit one ownership boundary, allowing the browser to initialize their content.
- Deeply nested render fragments avoid Python's recursion limit during scheduling and serialization.