Django-components

Latest version: v0.102

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

Scan your dependencies

Page 1 of 6

0.102

What's Changed

Fix
* refactor: fix for nested slots (698) by JuroOravec in https://github.com/EmilStenstrom/django-components/pull/699

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

**Full Changelog**: https://github.com/EmilStenstrom/django-components/compare/0.101...0.102

0.101

What's Changed

Fix

* Make sure BASE_DIR is a Path - fixesd 687 by spapas in https://github.com/EmilStenstrom/django-components/pull/668
* fix: Using empty default fill with no whitespace by JuroOravec in https://github.com/EmilStenstrom/django-components/pull/673
* fix: autoimport with nested apps by JuroOravec in https://github.com/EmilStenstrom/django-components/pull/672


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

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

Page 1 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.