djc / askama

Type-safe, compiled Jinja-like templates for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestion: improve external API for adding framework integrations

grimerssy opened this issue · comments

I don't see a reason to keep crates askama_actix, askama_axum etc. in the workspace of the project. Especially, when there is a misunderstanding on how to use this library with framework integrations (requirement to use crates mentioned above as project dependencies for derive macro to work). I suggest hiding imlementations of external traits behind feature flags inside of a main crate.

I implemented this as an example for axum, see commit.
Which works as expected and allows for removing askama_axum dependency.

If mentioned changes are welcome, I'll finish with all integrations and open a PR.

That you don't see the reason doesn't mean it doesn't exist.

IIRC I started the integrations out like this, but ran into issues when one integration needed to depend on a different version of a dependency compared to another integration.

So there are good reasons it's set up the way it is, and I'm not inclined to change it now. What is your motivation for wanting to change the setup here?

Every breaking change in any framework would be a breaking change in askama. New semver incompatible version of {axum,actix-web,…} → new semver incompatible version of askama. That would mean an excessive amount needless of work for downstream users.

I only suggested the change since I don't know much about history of designing this crate. Thanks for the quick feedback