Skip to content

AssetMapper: upgrade packages when needed#996

Merged
fabpot merged 1 commit intosymfony:1.xfrom
weaverryan:asset-mapper-upgrade-packages
Oct 22, 2023
Merged

AssetMapper: upgrade packages when needed#996
fabpot merged 1 commit intosymfony:1.xfrom
weaverryan:asset-mapper-upgrade-packages

Conversation

@weaverryan
Copy link
Copy Markdown
Contributor

Hi!

The scenario:

  • User installs symfony/ux-autocomplete. Flex adds tom-select at version 2.2.3 to importmap.php
  • 3 months later, user upgrades symfony/ux-autocomplete. The new version now requires tom-select at ^2.5.

If we do nothing, the user's tom-select is out of date and the user won't even know about it. The ^2.5 constraint is defined in the symfony/ux-autocomplete package.json file, but nothing enforces that or notifies the user.

With this small change, during a composer update/require, we look at the dependencies of all UX packages and compare them against the version in importmap.php. If they do not match, the package is upgraded to a version that matches.

Screenshot 2023-10-22 at 1 45 41 PM

We're not creating a fully-fledge package management by any means, but we don't need to. With a few notifications and things like this, we can keep the user's dependencies in sync with each other.

Unrelated: don't forget about that really cool other PR #978 ;)

Cheers!

@weaverryan
Copy link
Copy Markdown
Contributor Author

fabbot failures are incorrect - they're trying to add PHP 8 only functions, while 1.x works on 7.1.

@fabpot fabpot force-pushed the asset-mapper-upgrade-packages branch from 4376a14 to 5214615 Compare October 22, 2023 18:00
@fabpot
Copy link
Copy Markdown
Member

fabpot commented Oct 22, 2023

Thank you @weaverryan.

@fabpot fabpot merged commit 884a881 into symfony:1.x Oct 22, 2023
@weaverryan weaverryan deleted the asset-mapper-upgrade-packages branch October 22, 2023 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants