mirror of
https://github.com/robertwayne/axum-htmx
synced 2024-11-27 13:44:55 +01:00
2.7 KiB
2.7 KiB
Changelog
v0.6.0
- Added support for Vary headers in responses via the
VaryHxRequest
,VaryHxTarget
,VaryHxTrigger
, andVaryHxTriggerName
responders. (@imbolc) - Header names/values are now typed as
HeaderName
andHeaderValue
instead of&str
. (@imbolc) HxError
now implements source onerror::Error
. (@imbolc)- Added
AutoVaryLayer
middleware to automatically manageVary
headers when using corresponding extractors. The middleware is behind theauto-vary
feature. See this section of the README for more details.. (@imbolc)
v0.5.0
There are some several breaking changes in this release. Big thanks to @ItsEthra for their work in several PRs!
- All responders now take an
HxEvent
instead of aString | HxEvent
. When theserde
flag is enabled, it will expose additional data fields. HxResponseTrigger
is now a simple struct containing anTriggerMode
and aVec<HxEvent>
. There are several methods to make constructing these easier:HxResponseTrigger::normal
,HxResponseTrigger::after_settle
, andHxResponseTrigger::after_swap
.- The
HxCurrentUrl
extractor now returns anOption<axum::http::Uri>
instead of aString
. If the Uri cannot be parsed, it will returnNone
. - All Uri-related responders now impl
TryFrom<&str>
. HxError::Serialization
has been renamed toHxError::Json
.- The
HxResponseTrigger*
header will not be added to the response if the event list is empty. - Added feature flag badges and made additional updates to the docs.rs pages.
- Reduced dependency count / compile time by swapping
axum
out for theaxum-core
,async-trait
, andhttp
crates.
v0.4.0
- Added support for all htmx response headers via a type implementing
IntoResponseParts
. These "responders" allow you to simply and safely apply the HX-* headers to any of your responses. Thanks to @pfz4 for the implementation work! (#5)
v0.3.1
- Rebuild docs with features enabled so
HxRequestGuardLayer
is visible on docs.rs.
v0.3.0
HxRequestGuardLayer
now redirects on failures instead of returning a 403. By default, it will redirect to "/", but you can specify a different route to redirect to withHxRequestGuardLayer::new("/your-route-here")
.
v0.2.0
- Added
HxRequestGuardLayer
, allowing you to protect an entire router from non-htmx requests.
v0.1.0
- Initial release.