mozilla-services / syncstorage-rs

Sync Storage server in Rust
Mozilla Public License 2.0
973 stars 49 forks source link

Update to actix-web 1.0 #126

Closed pjenvey closed 5 years ago

pjenvey commented 5 years ago

Edit: switched out this issue to solely focus on upgrading actix-web 1.0

fzzzy commented 5 years ago

Running the above commands currently errors out at cargo update because of version conflicts with ring. I've seen this before. It requires choosing versions of all dependencies which depend on ring such that they all depend on the same version of ring. So, this will take some work to investigate a working combination of versions.

jrconlin commented 5 years ago

Looks like actix-web is working on 1.0.0 which updates a bunch of that.

Unfortunately. looks like there are also a number of breaking changes.

jrconlin commented 5 years ago

So, most of the changes are reasonably easy to deal with in the code. Two are a lot less so.

Apparently actix dropped rolling your own middleware, and having a TestServer.

pjenvey commented 5 years ago

actix-web's migration to 1.0 doc:

https://github.com/actix/actix-web/blob/master/MIGRATION.md

describes many of the App's initialization call changes that affects us, e.g. App::with_state(T) -> App.new().data(T)

A couple examples of conversion of custom Middleware -> Transform trait here:

https://github.com/actix/examples/commit/14eed91fcd73aa65247e145ed394d86989a93ee3#diff-24d9e194249630e11f90021cf6cecafd

The first rc is slated for release after the current beta3: https://github.com/actix/actix-web/issues/722#issuecomment-489384976

pjenvey commented 5 years ago

I'm postponing this upgrade for now. The upgrade of everything except middleware isn't too bad. We have an extensive use of middleware that calls into our extractors (FromRequest) and the 1.0 upgrade complicates this.

actix-web 1.0 upgrade requirements:

for the middleware:

fzzzy commented 5 years ago

🎉🏆💯🎆