- cross-posted to:
- hackernews@lemmy.bestiver.se
- rust@lemmit.online
- cross-posted to:
- hackernews@lemmy.bestiver.se
- rust@lemmit.online
axum is an ergonomic and modular web framework built with Tokio, Tower, and Hyper
We got done upgrading to 0.7 at $DAYJOB just a few weeks ago. 🫠
But this release does look significantly more manageable. 0.7 was the release where they switched to
http
1.0 andhyper
1.0, which meant we had to upgrade the entire networking stack in one fell swoop. And it’s a distributed application, so there’s a lot of components that do networking…Same situation here :D
Were you also blocked by opentelemetry?
Yeah, it was kind of the last real blocker, but we have a somewhat special setup where we serve HTTP and gRPC on the same port, for which we had integrated Axum with Tonic. Before the 0.7 release, Axum had an example for how to do this. After the release, that example was commented out with a TODO. So, we were kind of waiting for that to be documented. I mean, I didn’t have terribly high hopes, as they probably wouldn’t put a TODO in there, if it was trivial to upgrade, but if they struggled with it, I really didn’t want to have to figure it out myself.
But they seem to have actually even removed the example now, so I guess, it was the right call to just push through and throw down whatever ugly code makes it work…
We understand that this is a breaking change for basically all axum users
Lol.
I love the changes. Probably better to get this over with now than to wait until it’s no longer feasible to make this kind of breaking change. The
Option
extractor change is also nice - makes for some much more ergonomic error conditions.every once in a while i get it in my head to follow some web tutorial for a rust thing but then i grow weary knowing that syntax and structure will have changed dramatically in the month or two since the guide was made
This is true of so many ecosystems. In the past year, I think I’ve had to rewrite an ESLint config twice, transition a Prettier config to another format, update React in a project and a good half of the other dependencies through some breaking changes, etc.
It’s not really unique to Rust, and happens for projects that are well past v1 (in React’s case, v19 - and they still haven’t figured out suspense, not that I’d want to rush them).
Still, I’d love for things to remain consistent over time. The breaking changes in this version of axum are pretty easy to update to though, and you might even be able to just regex replace these in all your files since it’s just a matter of using braces now instead.
The JS ecosystem is in another league entirely. I don’t understand how it’s possible to develop in that world without losing all hope of writing good software. To be fair, many frontend devs seem somewhat resigned in that regard.
FWIW, the last breaking release of axum before this came out in Nov 2023.
I would also argue that the vast majority of axum tutorials still “work” - your app would panic at startup if using the old path capture syntax with a note that the syntax changed which should immediately get you back on track, and I wouldn’t expect the other features that were changed in a breaking manner to be used in tutorials much.
Rust is an awesome language, but an outright disconcerting percentage of libraries have versions starting with “0”, so I get what you mean. Keeping your dependencies up to date is usually no biggie, but it’s definitely not always the easiest. There’s also a bit of churn in what is considered the correct way to do things. Some stuff is settled, but some definitely isn’t. So I get it if you don’t want to jump in just yet.
Out of all the languages I have ever worked with upgrading dependencies in Rust is literally the easiest. All the times when that was hard in Rust it was hard for reasons that literally affect all languages such as a library that had become unmaintained or a significant API change to an obscure library. The major libraries implementing common functionality are all very well managed and barely ever have breaking changes.