Review main Merged

74361[TASK] Properly deprecate the check for the SiteLanguageAwareTrait

Oliver Klee CR +2 V +2 Normal +83 −1 updated 06/03/22, 15:32

Commit message

In #87380, it was recommended to use the `SiteLanguageAwareInterface`
instead of the `SiteLanguageAwareTrait` for marking classes as site
language aware. The usage of the trait for this was never properly
deprecated - it was only marked as "at any time after TYPO3 v11",
which is not specific enough.

The proper deprecation is now done so the check for the trait can
be removed for TYPO3 v13.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Oliver Hader +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Oliver Hader +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 4454

Show 2429 earlier messages
  1. Oliver Klee uploaded patch set 1 04/20/22, 12:22

  2. core-ci voted on patch set 1 V -1 04/20/22, 12:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26229

  3. Oliver Klee marked it work in progress 04/20/22, 12:53

  4. Oliver Klee uploaded patch set 2 04/20/22, 14:20

  5. Oliver Klee marked it ready for review 04/20/22, 14:20

  6. core-ci voted on patch set 2 V +1 04/20/22, 14:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26235

  7. Oli Bartsch commented on patch set 2 04/20/22, 14:43

    Deprecation-97435-DeprecateSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:12

    Usually, class names and methods use the :php:`` declaration for inline code.

    Deprecation-97435-DeprecateSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:20

    We should add the purpose here as well "using the SiteLanguageAwareTrait for ..."

    Deprecation-97435-DeprecateSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:22

    Could we please add corresponding sections "Affected installations" and "Migration"? The latter might contain a code example.
  8. Oliver Klee commented on patch set 2 04/20/22, 14:49

    Deprecation-97435-DeprecateSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:12 Reply

    Ack

    Deprecation-97435-DeprecateSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:20 Reply

    Ack

    Deprecation-97435-DeprecateSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:22 Reply

    Ack
  9. Oliver Klee marked it work in progress 04/20/22, 14:49

  10. Oliver Klee uploaded patch set 3 04/22/22, 10:18

  11. Oliver Klee commented on patch set 2 04/22/22, 10:18

    This change is ready for review.

    Deprecation-97435-DeprecateSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:12 Reply

    Done.

    Deprecation-97435-DeprecateSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:20 Reply

    Done.

    Deprecation-97435-DeprecateSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:22 Reply

    Done.
  12. Oliver Klee marked it ready for review 04/22/22, 10:18

  13. core-ci voted on patch set 3 V +1 04/22/22, 10:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26294

  14. Stefan Bürk commented on patch set 3 04/22/22, 16:34

    Deprecated in v12, removal in v13. So no backport of this. The comment in v11 is good enough and need no change at all.

    AspectFactory.php:120

    Should we not add a proper `trigger_error('deprected', E_USER_DEPRECATED)` with proper message here ?
  15. Nikita Hovratov uploaded patch set 4 04/22/22, 19:31

  16. Nikita Hovratov commented on patch set 4 04/22/22, 19:32

    Added the deprecation trigger and emphasized, that the trait is internal and should not be used in user extensions.

    Reply

    Done

    AspectFactory.php:120 Reply

    Done
  17. core-ci voted on patch set 4 V +1 04/22/22, 19:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26318

  18. Oliver Klee commented on patch set 4 CR +1 04/22/22, 19:53

    Thanks, Nikita!
  19. Stefan Bürk commented on patch set 4 04/24/22, 19:44

    Deprecation-97435-UsageOfSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:56

    Using `use SiteLanguageAwareTrait;` is valid to get the functionality in, if not implenting the interface methods directly. I think we should state that properly, that either implement the methods OR using the trait is okay (as long as the Inteface is implemented. Eventually emphasizes with a dedicated _note block to make that clear.
  20. Nikita Hovratov commented on patch set 4 04/24/22, 19:47

    Deprecation-97435-UsageOfSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:56 Reply

    I removed the recommendation for the trait as it is marked as @internal. Not sure if it is necessary in the end and we can open it for public API.
  21. Oli Bartsch commented on patch set 4 04/25/22, 08:53

    AspectFactory.php:124

    I think this message is a bit misleading now, since no information is given, regarding what stops working in v13.
  22. Oliver Klee commented on patch set 5 04/25/22, 14:30

    Published edit on patch set 4.
  23. Oliver Klee commented on patch set 5 04/25/22, 14:30

    AspectFactory.php:124 Reply

    Done
  24. Oliver Klee voted on patch set 5 CR +1 04/25/22, 14:30

  25. core-ci voted on patch set 5 V +1 04/25/22, 14:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26401

  26. Oliver Klee commented on patch set 5 04/25/22, 14:51

    Deprecation-97435-UsageOfSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:56 Reply

    Done
  27. Nikita Hovratov uploaded patch set 6 04/25/22, 15:20

  28. Nikita Hovratov commented on patch set 6 04/25/22, 15:21

    Added full migration example and wrapping of deprecation text.
  29. Oliver Klee commented on patch set 6 CR +1 04/25/22, 15:21

    Thanks, Nikita!
  1. core-ci voted on patch set 6 V +1 04/25/22, 15:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26406

  2. Nikita Hovratov voted on patch set 6 V +1 CR +1 04/25/22, 15:33

  3. Oliver Klee rebased onto patch set 7 05/05/22, 07:50

  4. core-ci voted on patch set 7 V +1 05/05/22, 08:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26872

  5. Oliver Hader commented on patch set 7 05/05/22, 12:56

    I guess we can directly remove the trait (breaking) and add a corresponding RST for it, can't we?
  6. Oliver Klee commented on patch set 7 05/05/22, 12:59

    Reply

    No, we cannot yet (if I'm not mistaken)): The trait (as a marker) was not properly deprecated in V11 (which we now are doing for V12). So the first time we can remove it is for V13.
  7. Nikita Hovratov voted on patch set 7 V +1 CR +1 05/05/22, 17:05

  8. Simon Schaufelberger commented on patch set 7 CR -1 05/11/22, 11:37

    Deprecation-97435-UsageOfSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:56

    don't we use PSR2 in docs as well?
  9. Oliver Klee commented on patch set 8 05/11/22, 11:43

    Published edit on patch set 7.
  10. Oliver Klee commented on patch set 8 05/11/22, 11:44

    Deprecation-97435-UsageOfSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:56 Reply

    Done
  11. core-ci voted on patch set 8 V -1 05/11/22, 11:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27114

  12. Stefan Bürk commented on patch set 8 05/11/22, 11:53

    Reply

    The point is, if we want to deprecate/remove the trait at all - here it is depreacted to be used as "marker" for something. If class switches to the interface, the trait can be still used to share the same code. If I'm not wrong, core uses the trait along with the interface to use new registration but share the code. Or am I wrong ? Maybe we should decide to deprectate the trait at all, which means that classes have to be adjusted not using the trait.

    Deprecation-97435-UsageOfSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:45

    Missing "class" in front is a hard error as this is invalid code then. ``` class MyClass ```

    Deprecation-97435-UsageOfSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:56 Reply

    I think normally it should be PSR2 - maybe done to spare one line in example. However, missing "class" in front is a hard error as this is invalid code then. ``` class MyClass implements .... ```
  13. Stefan Bürk rebased onto patch set 9 05/11/22, 11:53

  14. Stefan Bürk commented on patch set 9 05/11/22, 11:54

    > Patch Set 8: Verified-1 > > Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27114 Rebase missing (enforcing pinned dind-image) .. thus the completly fail of the pipeline. Rebased to mitigate this.
  15. core-ci voted on patch set 9 V +1 05/11/22, 12:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27115

  16. Oliver Klee commented on patch set 10 05/11/22, 12:12

    Published edit on patch set 9.
  17. Oliver Klee commented on patch set 10 05/11/22, 12:13

    Deprecation-97435-UsageOfSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:45 Reply

    Done

    Deprecation-97435-UsageOfSiteLanguageAwareTraitToDenoteSiteLanguageAwareness.rst:56 Reply

    Done
  18. core-ci voted on patch set 10 V +1 05/11/22, 12:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27117

  19. Simon Schaufelberger voted on patch set 10 CR +1 05/11/22, 12:22

  20. Oliver Klee commented on patch set 10 05/11/22, 12:22

    I think there has been an misunderstanding: The point of this patch is to only deprecate using the trait without the interface, but not deprecating the trait. (Or in other words, deprecate properly what was already semi-deprecated.) :-) @Olly, do you have plans to deprecate the trait? Or are you fine with this approach?
  21. Oliver Hader commented on patch set 10 V +1 CR +1 05/30/22, 07:15

    Reply

    Sorry, I also have not been precise on that topic: 1) I never planned to remove the trait 2) I suggested to remove the USAGE of the trait in given class, since the trait implementation is @internal
  22. Oliver Hader commented on patch set 10 05/30/22, 07:21

    An additional check via extension scanner still might be useful to detect these trait usages... however it does not look like the AST-component currently would support it
  23. Stefan Bürk voted on patch set 10 V +2 CR +2 06/03/22, 15:31

  24. Stefan Bürk commented on patch set 10 06/03/22, 15:31

    Reply

    Done
  25. Stefan Bürk merged patch set 11 06/03/22, 15:32