Components

Latest version: v0.0.1a0

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

Scan your dependencies

Page 1 of 6

0.100

What's Changed

🚨 BREAKING CHANGES 🚨
- `django_components.safer_staticfiles` app was removed. It is no longer needed. (https://github.com/EmilStenstrom/django-components/pull/652)
- Installation changes:
- Instead of defining component directories in `STATICFILES_DIRS`, set them to [`COMPONENTS.dirs`](dirs).
- You now must define `STATICFILES_FINDERS`
- [See here how to migrate your settings.py](https://github.com/EmilStenstrom/django-components/blob/master/docs/migrating_from_safer_staticfiles.md)

Feat
- Beside the top-level `/components` directory, you can now define also app-level components dirs, e.g. `[app]/components`
(See [`COMPONENTS.app_dirs`](app_dirs)). (https://github.com/EmilStenstrom/django-components/pull/664)

Refactor
- When you call `as_view()` on a component instance, that instance will be passed to `View.as_view()`

**Full Changelog**: https://github.com/EmilStenstrom/django-components/compare/0.97...0.100

0.97

What's Changed

Feat
- You can now manually create cached templates with [`cached_template()`](https://github.com/EmilStenstrom/django-components/#template_cache_size---tune-the-template-cache) (https://github.com/EmilStenstrom/django-components/pull/647)

Fix
- Fixed template caching. (https://github.com/EmilStenstrom/django-components/pull/647)

Refactor
- The previously undocumented `get_template` was made private. (https://github.com/EmilStenstrom/django-components/pull/647)
- In it's place, there's a new `get_template`, which supersedes `get_template_string` (will be removed in v1). The new `get_template` is the same as `get_template_string`, except it allows to return either a string or a Template instance. (https://github.com/EmilStenstrom/django-components/pull/647)
- You now must use only one of `template`, `get_template`, `template_name`, or `get_template_name`. (https://github.com/EmilStenstrom/django-components/pull/647)


**Full Changelog**: https://github.com/EmilStenstrom/django-components/compare/0.96...0.97

0.96

What's Changed

Feat
- Run-time type validation for Python 3.11+ - If the `Component` class is typed, e.g. `Component[Args, Kwargs, ...]`, the args, kwargs, slots, and data are validated against the given types. (See [Runtime input validation with types](https://github.com/EmilStenstrom/django-components#runtime-input-validation-with-types)) (https://github.com/EmilStenstrom/django-components/pull/629)
- Render hooks - Set `on_render_before` and `on_render_after` methods on `Component` to intercept or modify the template or context before rendering, or the rendered result afterwards. (See [Component hooks](https://github.com/EmilStenstrom/django-components#component-hooks)) (https://github.com/EmilStenstrom/django-components/pull/631)
- `component_vars.is_filled` context variable can be accessed from within `on_render_before` and `on_render_after` hooks as `self.is_filled.my_slot` (https://github.com/EmilStenstrom/django-components/pull/632)

Fix
* Fix docs action by dalito in https://github.com/EmilStenstrom/django-components/pull/633
* fix: populate RequestContext with context processors by JuroOravec in https://github.com/EmilStenstrom/django-components/pull/643

**Full Changelog**: https://github.com/EmilStenstrom/django-components/compare/0.95...0.96

0.95

What's Changed

Feat
- Added support for dynamic components, where the component name is passed as a variable. (See [Dynamic components](https://github.com/EmilStenstrom/django-components#dynamic-components)) (https://github.com/EmilStenstrom/django-components/pull/627)

Refactor
- Changed `Component.input` to raise `RuntimeError` if accessed outside of render context. Previously it returned `None` if unset. (https://github.com/EmilStenstrom/django-components/pull/627)


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

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

Page 1 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.