sonata-project / SonataAdminBundle

The missing Symfony Admin Generator
https://docs.sonata-project.org/projects/SonataAdminBundle
MIT License
2.11k stars 1.26k forks source link

Symfony 6 support #7553

Closed Kocal closed 2 years ago

Kocal commented 2 years ago

Hi! :wave:

Feature Request

I recently joined a company which was stuck for a time with Symfony 4.4 because of Sonata Admin.

No offense here, I know how open-source projects work. Sonata Admin is a big open-source project with a lot of code and dependencies to keep compatibility with, maintainers are working on their free time, etc.. and thanks a lot! :heart:

I migrated our project to Sonata 4, around ~120 files were modified :exploding_head: (thanks for generic AbstractAdmin and CRUDController :heart_eyes:), we are now able to update to Symfony 5, and I would like to update to Symfony 6 when it will be available.

Even if Symfony 6 is not released yet (in less than 2 weeks!), I've already opened PRs on many bundles to add Symfony 6 support (and many of them were merged):

I would like to implement Symfony 6 support to Sonata Admin/SonataProject packages.

Is 4.x the best branch to works with? Or should I start working on 5.x branch? Supporting Symfony 6 shoulb not be a BC so targeting 4.x seems ok to me.

Thanks!

jordisala1991 commented 2 years ago

Hi! All help is very welcome. The only requirement is that the bundle / package where you add the support should be able to install the package in order to ensure it works with it.

We are already working on Sf 6, you have the main issue here: https://github.com/sonata-project/dev-kit/issues/1675

The current status is: SonataAdmin bundle relies on the SonataBlockBundle and exporter. For the SonataBlockBundle we first need support for KnpMenuBundle, and for the exporter we first need mongodb-odm support.

I already opened the KnpMenuBundle PR and is waiting for more reviews: https://github.com/KnpLabs/KnpMenuBundle/pull/445

And the mongodb is being worked on by @franmomu here: https://github.com/doctrine/mongodb-odm/pull/2375

I want to have the support ready before its out, but we are currently blocked on those points.

For your question, the lowest branch that has Sf 5 support should get Sf 6 and that applies for any bundle of Sonata.

jordisala1991 commented 2 years ago

Another thing you can check is the builds with Symfony 5.4. Before adding support all the deprecation should be solved. But afaik we are deprecation free here.

Kocal commented 2 years ago

Thanks @jordisala1991, I'm gonna take a look ASAP!

quazardous commented 2 years ago

Hi, Is there a document somewhere that could help me understand the version scheme/relation between SF and Sonata ?

For example I've a projet in SF 4.4.*. It runs with Sonata Admin 3.96. Last time I tried a composer update I totally ruined the project...

Sorry if the question is out of line...

jordisala1991 commented 2 years ago

Hi,

Is there a document somewhere that could help me understand the version scheme/relation between SF and Sonata ?

For example I've a projet in SF 4.4.*. It runs with Sonata Admin 3.96. Last time I tried a composer update I totally ruined the project...

Sorry if the question is out of line...

Hi! The relation between symfony and sonata is that we support at least one Lts release (4.4 at this time of writing) and all the possible next minors (not out of support) we can (5.3 at this time, and we are getting ready for 5.4 and 6.0). When symfony 5.4 comes out we will wait some time and probably go for 5.4 and 6.0 only support. We cant afford to maintain more versions.

About your other issue it has nothing to do with what versions do we support. If tomorrow we remove support for 4.4 , the next release will not be installable on composer with your requirements.

That being said it is hard to help with a vague description like 'it ruined my project'. It is better to open an issue following the issue template provided.

Thank you!

quazardous commented 2 years ago

Sorry I've added noise. I did my own mess OC.

My question is more about how to manage my composer.json. With SF it's quite easy if you want to stick with 4.4 you can use 4.4.* for all symfony package. If you want to go with 5.0 just put 5.0.*. It's not magic but it's a guideline.

But it seams less evident (to me) with Sonata because all bundles are not at the same level.

I'm just wondering if some global upgrade doc could provide some pointers on Sonata Bundles compatibility versions (like a grid).