Skip to content
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

Upgrade block-bundle to 4.x in sonata-project bundles #700

Closed
2 of 17 tasks
wbloszyk opened this issue Apr 24, 2020 · 5 comments
Closed
2 of 17 tasks

Upgrade block-bundle to 4.x in sonata-project bundles #700

wbloszyk opened this issue Apr 24, 2020 · 5 comments
Labels

Comments

@wbloszyk
Copy link
Member

wbloszyk commented Apr 24, 2020

Feature Request

After watching some issue with Blocks (sonata-project/SonataMediaBundle#1737, sonata-project/SonataMediaBundle#1732) I came up with an idea.

All sonata-project stable bundles(Sonata 3) using block-bundle 3.x but 4.x is released.

block-bundle 4.0 upgrade change:

  1. block constructor
  2. AbstractAdminBlockService/AdminBlockServiceInterface to EditableBlockService
  3. Return type hints
  4. Conflict with CoreBundle

Resolve something like: (I will add example son - PR for SonataNewsBundle)

  1. Remove block deprecations SonataClassificationBundle#488
  2. some steps needed
    • remove AbstractAdminBlockService/AdminBlockServiceInterface implementations
    • add methods from AbstractAdminBlockService
    • add methods from EditableBlockServce
    • methods from EditableBlockServie should not call Abstra... methods and vice versa
    • some check for override methods should be add
  3. I will describe it below
  4. Resolve conflict with CoreBundle

Return type hints return type hints

  1. move Block directory to Model/Block
  2. Create the same Class in Block like in example:
if (`SonataBlockBundle3`) {
    class SomeBlockService Extends Modal/Block/SomeBlockServie {}  
} elseif (`SonataBlockBundle4`) {
    // extends the came thing like Modal/Block/SomeBlockServie
    // we can add `EditableBlockService` becouse user make block-bundle MAJOR UPDATE
    class SomeBlockService Extends AbstractBlockService implements EditableBlockService
    {
        /**
        * var Modal/Block/SomeBlockServie
        */
        private $blockService;

        public function __construct($env, $someService)
        {
              $this->blockService = new Modal/Block/SomeBlockServie($env, $someService),
        }

        // add return type hints 
        public function configureSettings(OptionsResolver $resolver): void
        {
              $this->blockService->configureSettings($resolver);
        }
        .... // for all extended methods
    }  
}

Before start - resolve conflict with CoreBundle:

TODO:

  • sandbox
  • ecommerce
  • SonataAdminBundle
  • SonataClassificationBundle
  • SonataCommentBundle
  • SonataDashboardBundle
  • SonataDoctrineORMAdminBundle
  • SonataDoctrinePhpcrAdminBundle
  • SonataFormatterBundle
  • SonataMediaBundle
  • SonataNewsBundle
  • SonataPageBundle
  • SonataSeoBundle
  • SonataTimelineBundle
  • SonataTranslationBundle ??
@jorrit
Copy link

jorrit commented Jun 12, 2020

I think before ' add support for extensions 0.x to block-bundle 4.x to resolve core-bundle conflict' can be implemented, sonata-project/form-extensions needs to support Symfony 5. Otherwise the Symfony 5 compatibility of block-bundle 4.x is undone.

@wbloszyk
Copy link
Member Author

@jorrit CoreBundle is almost dropped in Sonata 3 and should not be support in Sonata 4 (as extensions 0.x). More info here:
sonata-project/dev-kit#697

I should update this issue becouse some things are changed.

@jorrit
Copy link

jorrit commented Jun 12, 2020

If that is the case, is it even a goal to support Symfony 5 in Sonata 3?

@wbloszyk
Copy link
Member Author

The goal for me now is drop all deprecated bundles and make stable sandbox 3.0 based on Symfony4.4 and Sonata 3.

IMHO sonata-project team is more focus on realease AdminBundle 4 now. Anyway I will help if it will be possible.

@wbloszyk
Copy link
Member Author

Close in favor for sonata-project/dev-kit#785

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants