axum-htmx
axum-htmx copied to clipboard
A set of htmx extractors, responders, and request guards for axum.
Here's how it looks (just a draft yet). Let me know if you're ok with the approach before I finish it. Also I've noticed you implemented tower middleware in the...
As discussed in #14 we could have a middleware to add a single `Vary: hx-request, hx-target, hx-trigger, hx-trigger-name` header to every response to address all possible HTMx caching issues. This...
This is a draft PR for #12. ## Changes - Added subproject `axum-htmx-derive` - It's `lib.rs` exports 2 methods: `hx_boosted_by` and `hx_boosted_by_async` - Code related to macroses resides in `boosted_by`...
Hi! I'd like to propose a macros feature in addition to `HxBoosted` extractor. Currently with axum-htmx we use `HxBoosted` like this: ``` async fn get_index(HxBoosted(boosted): HxBoosted) -> impl IntoResponse {...
Thank you for writing this extension. I have a relatively mid size project (internal) that uses axum + minijinja + htmx and as you mentioned in the README, we do...
I have this code, with that error message: ` pub async fn all_patients( TypedHeader(hx): TypedHeader, Extension(db): Extension, ... // other params ) -> Result { ... if hx { //
In current Rust, using `#[non_exhaustive]` on a structure prevents using the structure update syntax: ```rust let options = LocationOptions { target: Some("foo".into()), ..Default::default() }; ``` ``` error[E0639]: cannot create non-exhaustive...
I noticed that if I use the `HxBoosted` extractor instead of the `HxRequest` one to decide whether to return partial content then the vary header doesn't change. Is that intentional?...
Having infallible extractors makes them less flexible, it's generally better to let the user decide if they want the extraction to fail or not, especially considering the fact that you...
renamed the `uri` field everywhere to `path`, as is named in the original HTMX header, and make `LocationOptions` wrapped in an `Option` rather than using `is_default`.