friendica / friendica

Friendica Communications Platform
https://friendi.ca
GNU Affero General Public License v3.0
1.43k stars 341 forks source link

Support for Composer 1 will be shutdown on August 1st 2025 #14519

Open annando opened 6 days ago

annando commented 6 days ago

We have to switch to Composer 2 in one of the coming releases. It would be great to have some support from people who are familiar with this.

Art4 commented 5 days ago

I've taken at look at this issue. It seems that Composer v2 is holding back by the "fxp/composer-asset-plugin": "^1.4", dependency, that requires Composer Plugin API version ^1.0. So we should update fxp/composer-asset-plugin first.

But the source at https://github.com/fxpio/composer-asset-plugin stated:

Important:

The next major version of Composer Asset Plugin is so different, but also incompatible with the current version, that it became a new project named Foxy.

So I've taken a look at Foxy that seems to be unmaintained and the website https://foxypkg.com/ is down. It is also not compatible with Composer version 2.6.6.

As an alternative one should use this fork: https://github.com/php-forge/foxy

tl,dr; First we need to replace https://github.com/fxpio/composer-asset-plugin with https://github.com/php-forge/foxy or another library.

annando commented 5 days ago

@Art4 do you know what to do there? I personally don't completely understand what this library is exactly for.

Art4 commented 5 days ago

I can definitely help with composer and the dependencies, and I'm familiar with the use case of this library but not precisely with the composer-asset-plugin library. I have to lookup the impact first. Maybe we can replace it with Symfony Encore (https://symfony.com/doc/current/frontend/encore/index.html)

annando commented 5 days ago

I thought that Symfony was a complete framework solution?

Art4 commented 5 days ago

I thought that Symfony was a complete framework solution?

Symfony is both: a set of reusable PHP components that could be used together as a framework.

But as I see friendica does not use webpack but only installs the npm/bower dependencies and hotlink them, thus Encore will be to much. Maybe we should give https://asset-packagist.org/ or Symfony AssetMapper a try.

annando commented 5 days ago

Yeah, Friendica uses their own kind of "framework" that consists of a wild mix of external components and home brew libraries.

Art4 commented 5 days ago

The following dependencies are installed using the fxp/composer-asset-plugin library:

"bower-asset/base64": "^1.0",
"bower-asset/chart-js": "^2.8",
"bower-asset/dompurify": "^1.0",
"bower-asset/fork-awesome": "^1.1",
"npm-asset/cropperjs": "1.2.2",
"npm-asset/es-jquery-sortable": "^0.9.13",
"npm-asset/fullcalendar": "^3.10",
"npm-asset/imagesloaded": "4.1.4",
"npm-asset/jquery": "^2.0",
"npm-asset/jquery-colorbox": "^1.6",
"npm-asset/jquery-datetimepicker": "^2.5",
"npm-asset/jgrowl": "^1.4",
"npm-asset/moment": "^2.24",
"npm-asset/perfect-scrollbar": "0.6.16",
"npm-asset/textcomplete": "^0.18.2",
"npm-asset/typeahead.js": "^0.11.1"

Bower is deprecated, so maybe we have also to look for alternatives for theses dependencies.

Art4 commented 5 days ago

I managed to use https://asset-packagist.org/, see #14523.