-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move FromRequest
and IntoResponse
into their own crate?
#561
Comments
FromRequest
and IntoResponse
into their own crates?FromRequest
and IntoResponse
into their own crate?
I've two packages that extend axum.
For any project that may be extended, I move user-facing types into a separate |
This sounds like a very good idea! It's a little bit unfortunate that the generic type default of |
Uh yeah thats worth exploring when we do this. Not depending hyper would mean loosing |
I think it wouldn't hurt too much to have |
I agree with that 👍 |
I gave it a shot in #564 |
This can be resolved by tying it to a Edit: Oh no, looks like you had the idea before me 😅 |
Most crates that provide integrations with axum only need the
FromRequest
andIntoResponse
traits. Examples include maud, tower-request-id, tower-cookies, axum-flash, and others.These traits are somewhat more stable than the rest of axum. They haven't changed since 0.2 back in August, and also wont change in 0.4. So it is inconvenient for libraries since they have to bump their axum version to pull in changes that are essentially irrelevant, such as routing.
Because of this I think we should consider moving
FromRequest
andIntoResponse
to their own crate alongside implementations for non-local types such as the strings fromhttp
andbytes
. The traits would be re-exported from axum in the location they exist today.I think we should be quite conservative about what goes into this new crate. For example I wouldn't move
Html
andJson
even though those might be useful to some libraries. Ideally only what has to be moved should be moved.Basically the same pattern as
futures-core
andtower-service
and many other crates I'm sure.I suggest naming this crate
axum-core
.@jplatte thoughts?
The text was updated successfully, but these errors were encountered: