v0.131ยค
Featยค
-
Support for extensions (plugins) for django-components!
- Hook into lifecycle events of django-components
- Pre-/post-process component inputs, outputs, and templates
- Add extra methods or attributes to Components
- Add custom extension-specific CLI commands
- Add custom extension-specific URL routes
Read more on Extensions.
-
New CLI commands:
components list
- List all componentscomponents create <name>
- Create a new component (supersedesstartcomponent
)components upgrade
- Upgrade a component (supersedesupgradecomponent
)components ext list
- List all extensionscomponents ext run <extension> <command>
- Run a command added by an extension
-
@djc_test
decorator for writing tests that involve Components.- The decorator manages global state, ensuring that tests don't leak.
- If using
pytest
, the decorator allows you to parametrize Django or Components settings. - The decorator also serves as a stand-in for Django's
@override_settings
.
See the API reference for
@djc_test
for more details. -
ComponentRegistry
now has ahas()
method to check if a component is registered without raising an error. -
Get all created
Component
classes withall_components()
. -
Get all created
ComponentRegistry
instances withall_registries()
.
Refactorยค
-
The
startcomponent
andupgradecomponent
commands are deprecated, and will be removed in v1.Instead, use
components create <name>
andcomponents upgrade
.
Internalยค
- Settings are now loaded only once, and thus are considered immutable once loaded. Previously, django-components would load settings from
settings.COMPONENTS
on each access. The new behavior aligns with Django's settings.