Upgrade PagerfantaBundle to new version with B/C layer #175
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an alternative version of #169 with a B/C layer to try and map the bundle configuration from
WhiteOctoberPagerfantaBundle
toBabDevPagerfantaBundle
.The B/C layer involves interfacing directly with the container in a few ways:
white_october_pagerfanta
and map it to thebabdev_pagerfanta
configuration (since none of the child nodes were renamed, this part is pretty simple) and re-create the renamedwhite_october_pagerfanta.default_view
parameterwhite_october_pagerfanta.view_factory.class
parameter that I fully dropped to change thePagerfanta\View\ViewFactory
class to something else if so desired and to alias the renamedtwig.extension.pagerfanta
andwhite_october_pagerfanta.view_factory
service IDs (the aliases are deprecated in favor of the new bundle's service IDs)The one part of #169 (comment) not handled is a class mapping layer for the namespace change. It'd be easy to throw together a file with a bunch of
class_alias()
calls, but as also noted in the comment, a bunch of classes were made final so if someone were extending them then even the aliasing wouldn't save them from that API break.In addition to just upgrading to a supported bundle version that also removes one roadblock to full Symfony 5 support, there are a number of new features in the Pagerfanta library and/or PagerfantaBundle that could be interesting to Sylius users, including:
Pagerfanta\Pagerfanta
class, at some point it's going to make sense to move that logic into the serializers (both Symfony's and JMS') and improve the pager's use in an API context)