Django-components

Latest version: v0.102

Safety actively analyzes 682416 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 6

0.94

What's Changed

Feat
- django_components now automatically configures Django to support multi-line tags. (See [Multi-line tags](https://github.com/EmilStenstrom/django-components#multi-line-tags)) (https://github.com/EmilStenstrom/django-components/pull/624)
- New setting `reload_on_template_change`. Set this to `True` to reload the dev server on changes to component template files. (See [Reload dev server on component file changes](https://github.com/EmilStenstrom/django-components#reload-dev-server-on-component-file-changes)) (https://github.com/EmilStenstrom/django-components/pull/624)


**Full Changelog**: https://github.com/EmilStenstrom/django-components/compare/0.93...0.94

0.93

What's Changed

Feat
- Spread operator `...dict` inside template tags. See [Spread operator](spread-operator)) (https://github.com/EmilStenstrom/django-components/pull/596)
django
{% component "card" ...card_props / %}

- Use template tags inside string literals in component inputs. See [Use template tags inside component inputs](use-template-tags-inside-component-inputs)) (https://github.com/EmilStenstrom/django-components/pull/605)
django
{% component "card" text="Hello {{ person.name }}" / %}

- Dynamic slots, fills and provides - The `name` argument for these can now be a variable, a template expression, or via spread operator (https://github.com/EmilStenstrom/django-components/pull/609)
django
{% component "table" %}
{% fill "header-{{ current_column }}" %}
<b>
{{ current_column }}
</b>
{% endfill %}
{% endcomponent %}

- Component library authors can now configure `CONTEXT_BEHAVIOR` and `TAG_FORMATTER` settings independently from user settings (https://github.com/EmilStenstrom/django-components/pull/615)

Fix
* fix: mypy checking with django plugin is broken by batistadasilva in https://github.com/EmilStenstrom/django-components/pull/595

Refactor

* refactor: move kwargs resolution to render-time + cleanup by JuroOravec in https://github.com/EmilStenstrom/django-components/pull/594

Docs
* docs: add mkdocs by GabDug in https://github.com/EmilStenstrom/django-components/pull/420

New Contributors
* batistadasilva made their first contribution in https://github.com/EmilStenstrom/django-components/pull/595

**Full Changelog**: https://github.com/EmilStenstrom/django-components/compare/0.92...0.93

0.92

What's Changed

🚨 Breaking changes 🚨
- `Component` class is no longer a subclass of `View`. To configure the `View` class, set the `Component.View` nested class. HTTP methods like `get` or `post` can still be defined directly on `Component` class, and `Component.as_view()` internally calls `Component.View.as_view()`. (See [Modifying the View class](https://github.com/EmilStenstrom/django-components#modifying-the-view-class))

Feat
- The inputs (args, kwargs, slots, context, ...) that you pass to `Component.render()` can be accessed from within `get_context_data`, `get_template_string` and `get_template_name` via `self.input`. (See [Accessing data passed to the component](https://github.com/EmilStenstrom/django-components#accessing-data-passed-to-the-component))

- Typing: `Component` class supports generics that specify types for `Component.render` (See [Adding type hints with Generics](https://github.com/EmilStenstrom/django-components#adding-type-hints-with-generics))


**Full Changelog**: https://github.com/EmilStenstrom/django-components/compare/0.91...0.92

0.91

What's Changed
Fix
* Allow `None` for attrs and defaults in `html_attrs` tag by JuroOravec in https://github.com/EmilStenstrom/django-components/pull/591


**Full Changelog**: https://github.com/EmilStenstrom/django-components/compare/0.90...0.91

0.90

What's Changed
Feat
- All tags (`component`, `slot`, `fill`, ...) now support "self-closing" or "inline" form, where you can omit the closing tag:
django
{ Before }
{% component "button" %}{% endcomponent %}
{ After }
{% component "button" / %}

- All tags now support the "dictionary key" or "aggregate" syntax (`kwarg:key=val`):
django
{% component "button" attrs:class="hidden" %}

- You can change how the components are written in the template with [TagFormatter](customizing-component-tags-with-tagformatter).

The default is `django_components.component_formatter`:
django
{% component "button" href="..." disabled %}
Click me!
{% endcomponent %}


While `django_components.shorthand_component_formatter` allows you to write components like so:

django
{% button href="..." disabled %}
Click me!
{% endbutton %}


**Full Changelog**: https://github.com/EmilStenstrom/django-components/compare/0.89...0.90

0.89

What's Changed
* Fix the case when there is an `{% include %}` tag inside a component's template and the component is rendered with `render/render_to_response`, with the `context` kwarg specified. See https://github.com/EmilStenstrom/django-components/pull/582


**Full Changelog**: https://github.com/EmilStenstrom/django-components/compare/0.88...0.89

Page 2 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.