Skip to content

Commit 9ca8ff3

Browse files
committed
Version 1.1.0
1 parent 9b0233e commit 9ca8ff3

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

CHANGELOG.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.1.0] - 2025-08-15
11+
12+
### Changed
13+
- **BREAKING**: Refactored `get_model_subscriptions` to use explicit action parameters instead of auto-subscribing to all actions by default
14+
- Changed default behavior from implicit subscription to all actions to explicit opt-in only
15+
- Updated command queue to subscribe to both instance and model-level signals for better coverage
16+
1017
### Added
1118
- **Custom Context Support for Render Command**: The `Render` command now accepts an optional `context` parameter of type `dict[str, Any]`. When provided, this context will override the component's default context during template rendering, while preserving essential HTMX variables (`htmx_repo`, `hx_oob`, `this`). This enables more flexible template rendering scenarios where you need to pass custom data that differs from the component's state.
19+
- Added type annotation `Action = Literal["created", "updated", "deleted"]` for better type safety
20+
- Support for `None` in actions parameter to include bare prefix subscriptions
1221

13-
### Changed
14-
- The `Render` dataclass now includes a `context: dict[str, Any] | None = None` field
22+
### Technical Details
23+
- The `Render` dataclass now includes a `context: dict[str, Any] | None = None` field
1524
- The `Repository.render_html` method signature now includes an optional `context` parameter
1625
- Template rendering logic now supports context override while maintaining backwards compatibility
17-
18-
### Technical Details
19-
- All changes are fully backwards compatible - existing code continues to work without modification
26+
- All custom context changes are fully backwards compatible - existing code continues to work without modification
2027
- When `context=None` (default), behavior is identical to previous versions
2128
- When `context` is provided, it takes precedence over component context but essential HTMX context variables are preserved
22-
- Comprehensive test coverage added for the new functionality
29+
- Comprehensive test coverage added for all new functionality
30+
31+
### Migration Guide
32+
- If you were relying on `get_model_subscriptions()` to automatically subscribe to all actions, you now need to explicitly pass the actions you want: `get_model_subscriptions(instance, actions=["created", "updated", "deleted"])`

src/djhtmx/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .middleware import middleware
22

3-
__version__ = "1.0.0"
3+
__version__ = "1.1.0"
44
__all__ = ("middleware",)

0 commit comments

Comments
 (0)