v0.141.0 (2025-06-10)ยค
__
Featยค
-
New extension hooks
on_template_loaded,on_js_loaded,on_css_loaded, andon_template_compiledThe first 3 hooks are called when Component's template / JS / CSS is loaded as a string.
The
on_template_compiledhook is called when Component's template is compiled to a Template.The
on_xx_loadedhooks can modify the content by returning the new value.class MyExtension(ComponentExtension): def on_template_loaded(self, ctx: OnTemplateLoadedContext) -> Optional[str]: return ctx.content + "<!-- Hello! -->" def on_js_loaded(self, ctx: OnJsLoadedContext) -> Optional[str]: return ctx.content + "// Hello!" def on_css_loaded(self, ctx: OnCssLoadedContext) -> Optional[str]: return ctx.content + "/* Hello! */"See all Extension hooks.
Fixยค
-
Subclassing - Previously, if a parent component defined
Component.templateorComponent.template_file, it's subclass would use the sameTemplateinstance.This could lead to unexpected behavior, where a change to the template of the subclass would also change the template of the parent class.
Now, each subclass has it's own
Templateinstance, and changes to the template of the subclass do not affect the template of the parent class. -
Fix Django failing to restart due to "TypeError: 'Dynamic' object is not iterable" (#1232)
-
Fix bug when error formatting failed when error value was not a string.
Refactorยค
components ext runCLI command now allows to call only those extensions that actually have subcommands.