-
-
Notifications
You must be signed in to change notification settings - Fork 136
Decouple from symfony/http-client #756
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
Comments
I agree with decoupling, we only need a But I personally don't like libraries that only require a contract (or a "provider" virtual package) and ask you to add an implementation. I would like beeing able to tell composer "I want a package that provide this implementation, if none are installed, use this one". But it's not possible at the moment composer/composer#6758 that's why I'm 👎 for this. |
Then you can go with second approach I suggested. Have a tiny wrapper package that comes with |
given Out of curiosity, what alternative implements the |
I don't know what alternative implements it, I just wanted to write adapter for some PSR client and use that. Maybe some another idea that could work is to have package double that is marked it "provides" async-aws/core. That way, people could require this package which doesn't have this dependency first, then concrete aws-async service package - this will result in not having to install real async-aws/core package and hence neither symfony/http-client. |
I've played with the idea a few times. But I find that
For example, how do we create a new HttpClient object if none is passed to us? Either we say "You need to install symfony/http-client", but since that is the only public implementation, why not require it and use it? With that said, There is nothing stopping you from passing your custom HttpClientInterface to use with AsyncAws, the downside is that you need to install Or is there something blocking you from using a custom HTTP client? |
Honestly, I don't know. I just never liked that official aws libraries require guzzle, but on the other hand your packages require Symfony httpclient, so that's not different. I thought ecosystem is past doing this kind of thing for new packages. So no, this is not the problem right now, but history taught us this will become a problem. Symfony http client will break the BC at some point. At this point, users will be blocked from installing this package if they still use libraries requiring different http client API. |
Let's close for now then, it will make more sense to open this with more available implementations |
I don't want to be forced to instal symfony/http-client. Can't this package be decoupled from it and use only contracts, or extracted to package which is decoupled?
The text was updated successfully, but these errors were encountered: