-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pagerfanta requirements #415
Conversation
If you’re going to add anything to the requirements, it really should just be the |
Thanks mbabker. I was not aware of the pagerfanta packages. To just require the needed package make a lot more sense. PR is updated |
After checking the code I found other dependencies requiring speciefied subpackage of pagerfanta
For classes:
The main problem is that the adapter classes will also install further packages, which I would suggest to revert my commit and use I can remeber that the resource-bundle will drop Mongo and CR support in higher versions. So we can easily add the orm package then. Otherwise a user have to install a pagerfanta package himself, when he will install the resource-bundle |
I think to avoid bc-break we can move pagerfanta/pagerfanta on main requirements on 1.8 & 1.9. on future grid bundle release, we already have this (not released yet) |
The problem here is no different than Symfony itself with its optional dependencies. Actually, the Pagerfanta and Symfony monorepos are kind of the same in that they don’t install all of the optional dependencies and users are still forced to make sure the full dependency stacks are in place (the Pagerfanta monorepo doesn’t install any of the Doctrine packages or Twig, but the subsplits do have those dependencies declared). Using the monorepo is fine, but from a downstream consumer perspective, it will cause issues by not installing all required transient dependencies and it won’t adequately lock version ranges (you can install the ORM 3.0 branch with the monorepo and it won’t raise a flag, but do the same with the ORM adapter package and you’ll get Composer warnings). Short term, using the monorepo might “fix” any immediate issues, but long term folks really should stop using it. |
Hmm, I didn't realize another 1.8 release was made alongside 1.9 and that the Pagerfanta major version bump was included in that. #381 IMO should be reverted from 1.8, having a major version bump on a dependency in a patch release seems like it's asking for trouble. If anything, 4404859 (which was the initial version of #298 before it was changed to 3.0 only) should be used which allows both Pagerfanta 2.x and 3.x to be installed. |
@@ -26,7 +25,7 @@ final class PagerfantaBridgePassTest extends AbstractCompilerPassTestCase | |||
*/ | |||
public function it_creates_aliased_services_and_changes_the_view_factory_class(): void | |||
{ | |||
$this->registerService('pagerfanta.twig_extension', PagerfantaExtension::class); | |||
$this->registerService('pagerfanta.twig_extension', class_exists('Pagerfanta\Twig\Extension\PagerfantaExtension') ? 'Pagerfanta\Twig\Extension\PagerfantaExtension' : 'BabDev\PagerfantaBundle\Twig\PagerfantaExtension'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can always use Pagerfanta\Twig\Extension\PagerfantaExtension
here. Since the bundle's 2.5 release, that's the class used for the pagerfanta.twig_extension
service, and with the version constraints given, it'll always be available.
Hey folks, thanks a lot for your contribution @gseidel. Your first in this repository! I wish it would be in better circumstances ;) But coming back to the implementation itself, I fail to see how this change would help you fix your repository. According to the change, a composer will try to solve the highest possible dependencies, so you still will have to define the proper pagerfanta version, or am I wrong? it seems, that the only revert proposed by @mbabker will solve 1.8 compatibility issues. Next question is, how broke is the 1.9 release. |
4170a0a
to
4d9082f
Compare
Hello @lchrusciel. Don't worry about the circumstances, I using this bundle for a long time already and finally I can contribute ;) This PR will fix two cases. My case is, that I can upgrade to On the other hand, their may be people who can't upgrade to version |
Ah, now I see. So the first line of fix will be to revert our 1.8 change. From what I know, @loic425 is in favour of your solution as well for 1.9, but that can be done in a little bit slower pace :) |
@gseidel can you check your app with https://github.com/Sylius/SyliusResourceBundle/releases/tag/v1.8.4? |
this PR should be rebased to 1.9 after #417 merge |
Yes it works, thank you! |
I close this PR and rebase it to branch |
Since version
1.8.3
the requirementbabdev/pagerfanta-bundle
was upgraded to version^3.0
. But this version requirespagerfanta/core
instead ofpagerfanta/pagerfanta
. So in the SyliusResourceBundle we have missing classes likePagerfanta\Adapter\DoctrineORMAdapter
which is not part of the pagerfanta core. This leads to no more working code if people don't installpagerfanta/pagerfanta
their own. This PR will fix this requirements.