What's Changed
Fix
-
Fix error that occured when calling
Component.inject()
inside loops:class MyComponent(Component): def get_template_data(self, args, kwargs, slots, context): data = self.inject("my_provide") return {"data": data}
{% load component_tags %} {% provide "my_provide" key="hi" data=data %} {% for i in range(10) %} {% component "my_component" / %} {% endfor %} {% endprovide %}
-
Allow to call
Component.inject()
outside of the rendering:comp = None class MyComponent(Component): def get_template_data(self, args, kwargs, slots, context): nonlocal comp comp = self template_str = """ {% load component_tags %} {% provide "my_provide" key="hi" data=data %} {% component "my_component" / %} {% endprovide %} """ template = Template(template_str) rendered = template.render(Context({})) assert comp is not None injected = comp.inject("my_provide") assert injected.key == "hi" assert injected.data == "data"
Refactor
- Removed circular references to the Component instances. Component instances
are now garbage collected unless you keep a reference to them.
Docs
- fix: fix link to Adding slot page in getting started doc. by @Antoliny0919 in #1374
- docs: add discord link to documentation and README. by @Antoliny0919 in #1386
- docs: document how to serve documentation website by @JuroOravec in #1391
- docs: add first sponsor.🙌 by @Antoliny0919 in #1393
- refactor: move logos and sponsors to assets dir by @JuroOravec in #1405
- docs: fix example by @JuroOravec in #1406
- docs: Add Juro to FUNDING.yml by @JuroOravec in #1407
- docs: document project board and labels by @JuroOravec in #1408
- docs: document publishing by @JuroOravec in #1409
- docs: add Form and Tabs examples by @JuroOravec in #1411
Full Changelog: 0.141.5...0.141.6