sonata-project / dev-kit

Development kit of the Sonata-Project
https://master-7rqtwti-ptm4dx6rjpjko.eu-5.platformsh.site/
42 stars 42 forks source link

Prepare bundles to major release #780

Closed wbloszyk closed 3 years ago

wbloszyk commented 4 years ago

SonataCoreBundle was dropped and last conflict was resolve. It mean we can use master branches (sonata4) with sonata3. :tada:

Of course this will be so beautiful to be true. Anyway after some easy change it is possible.

Last issue

Problem

As you know AbstractAdmin and AbstractBlockService are used in Sonata3 bundles without return type hints and we can't use it with Admin/BlockBundle v4 with return type hints.

Solutions

  1. Add return type hints in Sonata3 - BC-break
  2. Release AdminBundle as last bundle in Sonata4 and for people to upgrade it as last too - :-1:
  3. Drop return type hints in Admin/BlockBundle where this is needed and revert it in Sonata5 - :+1: :1st_place_medal:
    • add return type hints in other Sonata4 bundles will allow do revert it in Sonata5

TODO

prepare Admin/BlockBundle v4

Prepare 3.x branches

Prepare master branches

I will split it to TODO PRs list after approve this idea.

VincentLanglet commented 4 years ago

I'm not convinced by the fact to use a v3 bundle with a v4 bundle. In the same way Symfony 5 is not always compatible with Symfony 4 bundles.

IMO SonataAdmin v4 should support Block v4, and SonataAdmin v3 should support Block v3 In the same way SonataDoctrineORMAdmin v4 should support SonataAdmin v4, and SonataDoctrineORMAdmin v3 should support SonataAdmin v3

core23 commented 4 years ago

I'm not convinced by the fact to use a v3 bundle with a v4 bundle. In the same way Symfony 5 is not always compatible with Symfony 4 bundles.

First, we are not symfony. Symfony supports at least two versions, e.g the latest LTS version and the current major version for the framework itself

IMO SonataAdmin v4 should support Block v4, and SonataAdmin v3 should support Block v3 In the same way SonataDoctrineORMAdmin v4 should support SonataAdmin v4, and SonataDoctrineORMAdmin v3 should support SonataAdmin v3

This version strategy caused a lot of trouble for us in the last 2-3 years where we started working on new major versions. This will even cause a lot of more trouble for the end users.

I agree, that we should enforce same major versions for the admin components, but not the rest of our bundles (block, seo, datagrid, ...).

VincentLanglet commented 4 years ago

This version strategy caused a lot of trouble for us in the last 2-3 years where we started working on new major versions. This will even cause a lot of more trouble for the end users.

I agree, that we should enforce same major versions for the admin components, but not the rest of our bundles (block, seo, datagrid, ...).

If I understand correctly, you mean that SonataAdmin v4 should support Block v4 and Block v3 SonataDoctrineORMAdmin v4 is allowed to only support SonataAdmin v4 ?

wbloszyk commented 4 years ago

@VincentLanglet We don't have support two version but we can support in in first release (4.0.0). and remove it in next minor(4.1.0). This allow people to upgrage one bundle, check it and upgrade another. I don't want to force people to upgrade all bundles at once and praying that it would work.

For example after this change using Admin v4 is possible with Sonata3. https://github.com/sonata-project/SonataAdminBundle/pull/6197/files

VincentLanglet commented 4 years ago

For example after this change using Admin v4 is possible with Sonata3. https://github.com/sonata-project/SonataAdminBundle/pull/6197/files

There is no Sonata3 project. Which one do you talk about ? There is SonataBlock, SonataCore, SonataAdmin, SonataDoctrineORMAdmin, ...

We may add support for both V3 and V4 BlockBundle for SonataAdmin and storages bundle. But SonataAdmin and storages bundles are IMHO meant to be updated together. So we don't need to remove typehint, and we should instead finish to add them every where.

An half-typehinted project will be a real mess. And you only delaying the issue with the typehint. Because if you add them back in SonataAdmin 5, you'll have the same issue with others bundle in order to support both SonataAdmin 4 and SonataAdmin 5.

I don't want to force people to upgrade all bundles at once and praying that it would work.

Almost every changes required to use the V4 are currently triggering a deprecation. If you fix every deprecations, you'll update to v4 smoothly.

core23 commented 4 years ago

We don't have support two version but we can support in in first release (4.0.0). and remove it in next minor(4.1.0). This allow people to upgrage one bundle, check it and upgrade another. I don't want to force people to upgrade all bundles at once and praying that it would work.

šŸ‘ This is the symfony way. They support the latest LTS and latest stable version.

This will also save a lot of time for us. Otherwise we have to release nearly all bundles in a very short time period, which is impossible for our small team. We are working on the next major version for years...

If I understand correctly, you mean that SonataAdmin v4 should support Block v4 and Block v3 SonataDoctrineORMAdmin v4 is allowed to only support SonataAdmin v4

šŸ‘ The admin bundles are strictly coupled, so there is no easy way in supporting two stable SonataORMAdmin/SonataMongoAdmin versions in one SonataAdmin stable version.

VincentLanglet commented 3 years ago

Closing since Sonata 4 is released.