NatLibFi / Skosmos

Thesaurus and controlled vocabulary browser using SKOS and SPARQL
Other
218 stars 94 forks source link

Package components/handlebars.js is outdated and causes warnings #1401

Open osma opened 1 year ago

osma commented 1 year ago

URL address of the page where you encountered the problem

Running php composer.phar install on PHP 8.1

Description of the problem

Getting a bunch of error messages when running Composer. First this:

Package robloach/component-installer is abandoned, you should avoid using it. Use oomphinc/composer-installers-extender instead.

and later this:

Deprecation Notice: Return type of Assetic\Asset\AssetCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/Skosmos/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollection.php:215
Deprecation Notice: Return type of Assetic\Filter\FilterCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/Skosmos/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterCollection.php:73
Deprecation Notice: Return type of Assetic\Filter\FilterCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/Skosmos/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterCollection.php:78
Deprecation Notice: Return type of Assetic\Asset\Iterator\AssetCollectionFilterIterator::getChildren() should either be compatible with RecursiveFilterIterator::getChildren(): ?RecursiveFilterIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/Skosmos/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionFilterIterator.php:80
Deprecation Notice: Return type of Assetic\Asset\Iterator\AssetCollectionFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/Skosmos/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionFilterIterator.php:50
Deprecation Notice: Return type of Assetic\Asset\Iterator\AssetCollectionIterator::hasChildren() should either be compatible with RecursiveIterator::hasChildren(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/Skosmos/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php:104
Deprecation Notice: Return type of Assetic\Asset\Iterator\AssetCollectionIterator::getChildren() should either be compatible with RecursiveIterator::getChildren(): ?RecursiveIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/Skosmos/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php:112
Deprecation Notice: Return type of Assetic\Asset\Iterator\AssetCollectionIterator::current($raw = false) should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/Skosmos/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php:54
Deprecation Notice: Return type of Assetic\Asset\Iterator\AssetCollectionIterator::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/Skosmos/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php:89
Deprecation Notice: Return type of Assetic\Asset\Iterator\AssetCollectionIterator::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/Skosmos/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php:84
Deprecation Notice: Return type of Assetic\Asset\Iterator\AssetCollectionIterator::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/Skosmos/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php:99
Deprecation Notice: Return type of Assetic\Asset\Iterator\AssetCollectionIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/Skosmos/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php:94
Deprecation Notice: strrpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/html/Skosmos/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php:40
Deprecation Notice: strrpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/html/Skosmos/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php:40
Deprecation Notice: strrpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/html/Skosmos/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php:40
Deprecation Notice: strrpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/html/Skosmos/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php:40

It's maybe not obvious at first, but these are caused by the package components/handlebars.js, which is a distribution of Handlebars.js repackaged for Composer. Looking at the dependency tree shows this:

$ php composer.phar show --tree
Loading "robloach/component-installer" which is a legacy composer-installer built for Composer 1.x, it is likely to cause issues as you are running Composer 2.x.
components/handlebars.js v4.7.7 Handlebars.js and Mustache are both logicless templating languages that keep the view and the code separated like we all know they should be.
└──robloach/component-installer *
   ├──kriswallsmith/assetic 1.*
   │  ├──php >=5.3.1
   │  └──symfony/process ~2.1|~3.0
   │     └──php ^5.5.9|>=7.0.8
   └──php >=5.3.2

It seems that components/handlebars.js isn't actively maintained (last release is from 2021-02-15, no activity since then in the GitHub repository) and the problem has also been reported as https://github.com/components/handlebars.js/issues/27 with no response in more than 2 years.

If we want to keep using Handlebars.js (and I think we still need it, at least for Skosmos 2.x), we should switch to another installation method.

osma commented 1 year ago

We will need to use another installation mechanism for Handlebars.js. We will need to create another build/install setup for Skosmos 3.x anyway.

joelit commented 1 year ago

Package removed from Skosmos 3.0, but this issue is still a concern for Skosmos 2.x.