elastic / elasticsearch-php

Official PHP client for Elasticsearch.
https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/index.html
MIT License
5.25k stars 964 forks source link

Why require `guzzlehttp/guzzle` while `elastic/transport` is client agnostic? #1337

Closed ruudk closed 11 months ago

ruudk commented 1 year ago

Summary of problem or feature request

Maybe I'm missing something, but why does this package depend on guzzlehttp/guzzle while elastic/transport can support any PSR client?

ezimuel commented 1 year ago

We decided to simplifying the usage of this library offering a default client, and we choose Guzzle. If you want, you can change the HTTP client using the setHttpClient() function of the client builder, here the documentation.

ruudk commented 1 year ago

I understand, but the fact that you require it as a dependency doesn't make sense to me. I think that you want to improve the Developer Experience to automatically require it, but people that pull in this dependency know how to also require a suggested HTTP client. It should be in suggests so that people can freely choose without pulling in Guzzle. I hope you can reconsider it ☺️

ezimuel commented 11 months ago

@ruudk thanks for your feedback, I agree from a technical point of view but from a product perspective this simplify the process. The majority of the users use guzzle. The only disadvantage is having guzzle installed even if you don't use it, and this is a rare case. That said, we can reconsider it in the next major release if the user scenarios and requirements will change.