Skip to content
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

actix-web >= 2.0.0 support #182

Merged
merged 5 commits into from
Mar 21, 2020
Merged

actix-web >= 2.0.0 support #182

merged 5 commits into from
Mar 21, 2020

Conversation

czyba
Copy link
Contributor

@czyba czyba commented Mar 3, 2020

Cheers,

With the advent of async, actix-web started using futures in their APIs and traits, unfortunately resulting in breaking changes within the Responder trait which maud implements.

I have added support for the newest version of actix-web while trying to still support version 1, since most users have probably not yet migrated to the newest version.

In order to do so I added the trait actix-web-2 feature and the actix-web-2-dep dependency in order to avoid name clashes. Unfortunately enabling the feature also depends on the futures crate, since it is used to implement the Responder trait. I also mentioned said support in the web-framework documentation. I have not added any tests, since there were no actix-web tests I could modify. I have verified that this change works within my own project though.

Note that futures dependency may not necessarily be required. It was used within actix-web itself to implement the Responder traits, but I could not trivially verify that it is strictly required to use that crate and not some other implementation.

P.S. Thanks for your awesome crate!

czyba added 2 commits March 3, 2020 20:20
In order to support both actix-web < 2.0.0 and >= 2.0.0 at the same
time I added a feature actix-web-2, which enables the actix-web
dependency with the respective version und the name active-web-2-dep
and the futures dependency which is required(?) for implementing the
Responder trait for >= 2.0.0.

Thus the user of maud has the choice to use actix-web in the version
they prefer.
@lambda-fairy
Copy link
Owner

Thanks for your contribution!

How about we drop 1.x support and only support 2.x?

Users who are still using actix-web 1.x can pin to an older version of Maud, so I don't think we need to support both at once.

@czyba
Copy link
Contributor Author

czyba commented Mar 7, 2020

Sure, I'll modify the PR accordingly!

czyba added 3 commits March 7, 2020 13:46
As discussed in Pull Request #182 we will only support actix-web 2.0.0
from this point onwards. If you still wish to use a previous version of
actix-web you'll have to pin the version.
@czyba
Copy link
Contributor Author

czyba commented Mar 7, 2020

I removed the 1.0.0 support and added only the 2.0.0 support. I reverted the changes to the documentation as well, since they are no longer necessary.

I also took the liberty to modify the changelog accordingly.

@lambda-fairy lambda-fairy merged commit dfa7d5a into lambda-fairy:master Mar 21, 2020
@lambda-fairy
Copy link
Owner

Merged, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants