Hello. I am developing a library that uses Guzzle as a dependency. Guzzle is a fairly popular library, so the likelihood that my library will be included in a project that already uses this HTTP client (or vice versa) is relatively large. The current stable version of Guzzle is 6.2.2.

I'm with Composer on "you", so I’m tortured by the questions: what happens if after a while I stop supporting the library? As a dependency, she will still have some version, say ^6.2 . But it will take time and the seventh version of Guzzle will be released. I read that Composer does not know how to store two different versions of the same dependency. It turns out that either my library will stop working for the user (if the API changes in version 7), or will the user have to use version ^6.2 ? How do library developers solve this problem?

I thank for the answers and apologize for the title, which I could not clearly formulate.

  • You can enter versioning in your library, then one version of your library will support one version of guzzle, and the other version. especially since versions are not just given. bugs fix, functionality improves - Connor Holt

1 answer 1

It depends on how incompatible the new major version of Guzzle has become.

  1. The changes did not completely break your compatibility - then in the composer you put guzzle/guzzle: ~6.0|~7.0
  2. Changes broke your compatibility - then you release your new major version, which uses the new major version of the library

If you suddenly stop supporting your library, you will certainly find craftsmen who are ready to throw you pull-requests with bug fixes, adding new features and changes to work with the new major version of the library used, you just need to view and accept requests. Or transfer control to someone else, you decide.