Skip to content

Remove guzzle dependency from LocationBundle #7694

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

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

mamazu
Copy link
Contributor

@mamazu mamazu commented Nov 30, 2024

Q A
Bug fix? no
New feature? no
BC breaks? yes
Deprecations? no (Removing deprecated code)
Fixed tickets -
Related issues/PRs #7687
License MIT
Documentation PR -

What's in this PR?

Removing the guzzle dependency from the project.

Why?

Currently we still have a dependency on the guzzle http implementation for BC reasons. This merge request removes the option to use the guzzle http client in the LocationBundle.

The reason is that the guzzle http client isn't even a depnency of Sulu and only installed because of the old flysystem dependency. See #7687 (comment)

@mamazu mamazu changed the base branch from 2.6 to 3.0 November 30, 2024 16:08
@mamazu mamazu force-pushed the remove-guzzle-dependency branch 6 times, most recently from d11d1fc to 3977825 Compare November 30, 2024 17:23
composer.json Outdated
@@ -50,7 +50,6 @@
"friendsofsymfony/jsrouting-bundle": "^3.0",
"friendsofsymfony/rest-bundle": "^3.2",
"gedmo/doctrine-extensions": "^3.8",
"guzzlehttp/promises": "^1.0 || ^2.0",
Copy link
Member

@alexander-schranz alexander-schranz Nov 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the promises package need to stay will not be removed they are required that the http cache working performant with the symfony http client:

Copy link
Contributor Author

@mamazu mamazu Nov 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. Very weird that this is not a dependency of either of those packages. Because we don't use any of the classes in the Sulu source code.

Readded.

Copy link
Member

@alexander-schranz alexander-schranz Nov 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mamazu you can use any php http implementation with the FosHttpCache component.

https://github.com/FriendsOfSymfony/FOSHttpCache/blob/6151c80350a1c54e8723f927a50ee2f90fcd19f9/composer.json#L29

As Symfony based we choose the Symfony Http Client it provides the async:

https://github.com/symfony/http-client/blob/955e43336aff03df1e8a8e17daefabb0127a313b/composer.json#L19

But its async implementation depends on guzzle promises (documented here) which is not a direct dependency as you can use it without async still.

We may can discuss with @dbu if the FOSHttpCacheBundle as it is a symfony bundle may could require it as I think its uncommon that somebody using another client inside a symfony project?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think that would make sense. But that's probably a topic for another pull request.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FOSHttpCache uses php-http/discovery which contains a composer plugin that requires a suiteable http client if none is already available in your project.

UPGRADE.md Outdated
@@ -28,6 +28,10 @@ Removed unused arguments:

The script provided by Sulu for the piwik implementation has been updated to use mataomo path so the script is now pointing to matomo.php instead of the piwik.php file.

### Removing deprecated guzzle integration

As part of the update of flysystem the package `guzzlehttp/guzzle` and `guzzlehttp/promise` have been removed. If you need it you need to manually require it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GoogleGeolocator and NominatimGeolocator not longer supporting the Guzzle Http Client instead a Symfony HttpClient instance need to give to its constructors now.

@mamazu mamazu force-pushed the remove-guzzle-dependency branch from bcdb82a to 5371975 Compare December 2, 2024 15:11
@alexander-schranz alexander-schranz enabled auto-merge (squash) December 2, 2024 15:18
@alexander-schranz alexander-schranz added Technical Debt Impacts code quality, no or just small impact on end developers and users DX Affecting the end developer labels Dec 2, 2024
@alexander-schranz alexander-schranz merged commit a442de4 into sulu:3.0 Dec 2, 2024
9 checks passed
@mamazu mamazu deleted the remove-guzzle-dependency branch December 2, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Affecting the end developer Technical Debt Impacts code quality, no or just small impact on end developers and users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants