core icon indicating copy to clipboard operation
core copied to clipboard

[State] Suddenly removes standalone contracts packages and imports whole contracts package

Open norkunas opened this issue 8 months ago • 2 comments

composer update api-platform/state:

Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 1 update, 6 removals
  - Removing symfony/cache-contracts (v3.6.0)
  - Removing symfony/deprecation-contracts (v3.6.0)
  - Removing symfony/event-dispatcher-contracts (v3.6.0)
  - Removing symfony/http-client-contracts (v3.6.0)
  - Removing symfony/service-contracts (v3.6.0)
  - Removing symfony/translation-contracts (v3.6.0)
  - Upgrading api-platform/state (v4.1.12 => v4.1.15)
  - Locking symfony/contracts (v3.6.0)

What's the reason for this?

norkunas avatar Jun 13 '25 10:06 norkunas

I'm confused indeed, I may have added contracts instead of specific sub components I'll check that.

soyuka avatar Jun 13 '25 14:06 soyuka

Except TypeInfo we didn't change much I still need to investigate.

soyuka avatar Jun 15 '25 04:06 soyuka

The dependency to symfony/contracts was added in https://github.com/api-platform/core/pull/7169

gharlan avatar Jun 26 '25 09:06 gharlan

actually all the removed components are just the replacements for their subtree split therefore we install just as much as previously. I'll keep this like that, if for some reason you want me to investigate more let me know.

soyuka avatar Jun 30 '25 12:06 soyuka

But what does it fix requiring whole contracts package? If Symfony in future will add more contracts, api-platform will implicitly depend on them without consuming them

norkunas avatar Jun 30 '25 12:06 norkunas

Note that you get stuck at version 4.1.12 of api-platform/state when just running composer update.

You have to explicitly run composer update api-platform/state to get newer version. And then the contract subtree packages are replaced by the base package.

gharlan avatar Jun 30 '25 12:06 gharlan