Releasing v0.4.0 #540
jondot
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We're releasing 0.4.0, for which the central focus was supporting multiple format responses in the same endpoint handler (i.e. returning different types). One important use case is returning JSON for `accept: application/json` and HTML for its relevant mime types.
One challenge was: how would the developer experience look like?
In Rails and Ruby it looks like this, very clean, due to lots of magic:
After a few iterations, we've come to shape it into this in Rust:
Taking advantage of
axum
extractors, we're usingFormat
to say "this is a responder type endpoint" and then usingmatch
to immitate Ruby's blocks aesthetics.Another DX improvement we made is for model validations, all you need is to implement
Validatable
now:get started: https://loco.rs/docs/getting-started/tour/
repo: https://github.com/loco-rs/loco
0.4.x changelog: CHANGELOG.md
Thanks @haoxins @RobertChang0722 @yinho999 @didy-kpn @clefelhocz2 @PolpOnline @AndreiOrmanji @spencewenski @assapir for participating in this release!
Beta Was this translation helpful? Give feedback.
All reactions