Replies: 10 comments 3 replies
-
I would vote to go for a very simple interface like the one Stripe uses. https://github.com/stripe/stripe-php/tree/master/lib/HttpClient They use a very simple interface so the user can implement their own and ship with a cURL client by default. The cURL extension is by and large a default and available almost always and has no composer dependencies. If we would go that route it's trivial to implement a Guzzle or whatever implementation that can be given to the SDK to do it's HTTP work without needing the full plumbing Htttplug provides which we workaround quite a lot already for timeouts and proxy configurations for example. Frameworks like Laravel and Symfony could also by default replace the client with the default shipped by their framework with a simple client implementation. |
Beta Was this translation helpful? Give feedback.
-
I would love to see |
Beta Was this translation helpful? Give feedback.
-
What is Symfony's statement on how long they will support v5.0 of their HTTP client library? |
Beta Was this translation helpful? Give feedback.
-
Symfony has its how LTS schedule, so that's not a problem: https://symfony.com/releases#symfony-releases-calendar IMHO we should still rely on PSR-18 as a decoupling interface to allow everyone to either use the provided client or swap-it-out with another custom one. This should give us the best of both worlds, because we can rely on any common HTTP client in PHP (even the Symfony one) to implement that one. |
Beta Was this translation helpful? Give feedback.
-
Using/building something PRS 18 compatible is definitely a good idea. @stayallive Is the Laravel HTTP client PSR 18 compatible? Maybe @richardm-stripe or @dcr-stripe are open about telling us about the reasoning behind Stripe opting into implementing their own HTTP client in their SDK 🙏 |
Beta Was this translation helpful? Give feedback.
-
Another input on this discussion: |
Beta Was this translation helpful? Give feedback.
-
@cleptric are you coming to SymfonyCon next month? Sentry has a booth so I was wondering. It'd be a nice opportunity to brainstorm about what @Jean85 just linked to ;) |
Beta Was this translation helpful? Give feedback.
-
See proposal at #1418 |
Beta Was this translation helpful? Give feedback.
-
@nicolas-grekas questions: how does it work on first install? The plugin would run during the post-install? Even if it has to be explicitly enabled now, with newer Composer versions? What happens if no compatible implementation is available? |
Beta Was this translation helpful? Give feedback.
-
Here is a PR to move this concern to php-http/discovery: php-http/discovery#208 The plugin runs on post-update yes. Of course if it's disabled then ppl take the responsibility to install the missing implementations on their own. The plugin is compatible with both composer v1 and v2 and with PHP >= 7.1. |
Beta Was this translation helpful? Give feedback.
-
Problem Statement
We're currently using Httplug to allow people to use their HTTP client of choice with the SDK.
This creates confusion about why we offer two composer packages
sentry/sentry
vssentry/sdk
.I also have the feeling that this is rarely used and slightly over-optimized.
Solution Brainstorm
Two good examples of other SDKs/libraries shipping with an HTTP client are the AWS PHP SDK (they use Guzzle) and Stripe (they implemented their own client).
While I do not think that Guzzle is necessary in our case, what other HTTP clients we could look into using in our SDK?
Beta Was this translation helpful? Give feedback.
All reactions