metaclass-nl / filter-bundle

Filter bundle for API Platform, Filter Logic
MIT License
50 stars 9 forks source link

Support ApiPlatform 3.0 #16

Closed benblub closed 1 year ago

benblub commented 1 year ago

I have not yet tested whether the bundle would support 3.0 in principle. Is that already something planned?

    - metaclass-nl/filter-bundle is locked to version v2.0.1 and an update of this package was not requested.
    - metaclass-nl/filter-bundle v2.0.1 requires api-platform/core ^2.5 -> found api-platform/core[v2.5.0, ..., v2.7.1] but it conflicts with your root composer.json require (^3.0).
metaclass-nl commented 1 year ago

Hi benblub,

IMHO [RFC] Filter composition and WhereFilter suggest that the current filters COULD be replaced entirely in 3.0. My remarks and suggestions based on metaclass-nl/filter-bundle being ignoored compeletely did not exactly make me more optimistic.

Last months i have seen a lot of ussues passing by, i guessed it had something to do with 3.0 but the process still seemed very difficult to suervey so no, i did not plan anything.

I just took an other look and now 3.0 seems to be merged into main, i guess the release is sort of stable now, so i should take a look to see if the filters are still there and if so, what changes are made. Of course any insights from you and others are welcome too. Depending on that i will share my intentions here, i hope next week, but i can not make any promises.

metaclass-nl commented 1 year ago

It looks like with respect to the filters themselves little has changed between 2.6 and 3.0, just that the filters have been moved to a new namespace. This would be a breaking change so for the filter-bundle to work with 3.0 a new major version will be necessary. But i can not yet comprehend the possible impact of the new metadata.

2.7 puzzles me, I guess the old version should work with metadata_backward_compatibility_layer=true and the new version with metadata_backward_compatibility_layer=false. But AFAIK this can not be expressed in the declared dependencies in composer.json of filter-bundle...

metaclass-nl commented 1 year ago

The new metadata does have an impact on LogicFilter, but mostly on the tests. I got lost in the new namespaces so that i could not estimate the time required. So i just made a start with the adaptation. I now have it working with 2.7 with metadata_backward_compatibility_layer=false, except Metaclass\FilterBundle\Filter\DateFilter which extends a class that is now final.

I hope to finish the work during this week but i can not make any promises because i do not know how much time i can actually spend. For those who don't want to wait i will push a branch 3.0 today with a bleeding edge development version. See its readme for its status.

metaclass-nl commented 1 year ago

It went much quicker then i expected. Released as v3.0.0.rc2