Review main Merged Breaking

73366[!!!][FEATURE] Override any backend template with TsConfig

Christian Kuhn CR +2 V +2 Nightmare +1422 −1491 updated 02/11/22, 13:19

Commit message

This patch finishes the migration to the new backend
templating strategy. Affected are the backend page
module and the dashboard extension:

* Bigger refactoring of PageLayoutController
  towards more modern and streamlined code with
  much less class state.
* Transition of fillDefaultsByPackageName() in
  the page module for the "grid" layout towards
  TsConfig based template overrides.
* Refactoring of the dashboard main controller
  to avoid fillDefaultsByPackageName().

The new template override API based on TsConfig
is now documented with a feature ReST file. The
new template override strategy is breaking for
existing overrides based on FE TypoScript and
documented with a breaking ReST file including
a detailed migration path. The ext:dashboard
documentation is adapted accordingly.

As a result, all backend controllers that do not
rely on extbase no longer parse FE TypoScript.
This is especially useful for the central page
module: Clicking around on a v12 bootstrap_package
page tree in the page module without the patch leads
to around 80 to 120 milliseconds parsetime on my
machine - depending on the number and complexity
of content elements and the cache state. This
systematically shrinks to around 50 to 70 milliseconds
with the patch: The system no longer loads tons of
extbase related classes, dependency injection is more
effective, and the entire FE TypoScript parsing is gone.
With cold caches ("Flush all caches" backend button),
the difference is around 100 milliseconds for the
first call on my system - in general, the bigger the
instance, the higher the improvement.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
  • Verified V +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 4

Files 43

Show 23 more files

Review log 3249

Show 1224 earlier messages
  1. Christian Kuhn uploaded patch set 1 02/08/22, 21:52

  2. core-ci voted on patch set 1 V -1 02/08/22, 22:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23243

  3. Christian Kuhn uploaded patch set 2 02/08/22, 22:16

  4. core-ci voted on patch set 2 V -1 02/08/22, 22:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23244

  5. Christian Kuhn uploaded patch set 3 02/08/22, 22:44

  6. core-ci voted on patch set 3 V +1 02/08/22, 22:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23245

  7. Christian Kuhn uploaded patch set 4 02/09/22, 18:14

  8. core-ci voted on patch set 4 V +1 02/09/22, 18:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23297

  9. Christian Kuhn uploaded patch set 5 02/09/22, 19:44

  10. core-ci voted on patch set 5 V -1 02/09/22, 19:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23298

  11. Christian Kuhn uploaded patch set 6 02/09/22, 19:46

  12. core-ci voted on patch set 6 V -1 02/09/22, 19:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23299

  13. Christian Kuhn uploaded patch set 7 02/09/22, 20:34

  14. core-ci voted on patch set 7 V -1 02/09/22, 20:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23302

  15. Christian Kuhn uploaded patch set 8 02/09/22, 20:41

  16. core-ci voted on patch set 8 V +1 02/09/22, 20:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23303

  17. Christian Kuhn uploaded patch set 9 02/09/22, 23:20

  18. core-ci voted on patch set 9 V +1 02/09/22, 23:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23307

  19. Christian Kuhn uploaded patch set 10 02/09/22, 23:37

  20. core-ci voted on patch set 10 V +1 02/09/22, 23:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23308

  21. Christian Kuhn uploaded patch set 11 02/10/22, 10:08

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

  23. Christian Kuhn uploaded patch set 12 02/10/22, 10:56

  24. core-ci voted on patch set 12 V +1 02/10/22, 11:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23326

  1. Christian Kuhn updated the commit message in patch set 13 02/10/22, 11:30

  2. core-ci voted on patch set 13 V +1 02/10/22, 11:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23328

  3. Georg Ringer commented on patch set 13 02/10/22, 12:26

    useful

    Breaking-96812-NoFrontendTypoScriptBasedTemplateOverridesInTheBackend.rst:83

    can we keep the 100 just to make the migration more obvious or use the same number above

    Breaking-96812-NoFrontendTypoScriptBasedTemplateOverridesInTheBackend.rst:115

    so use 110 hiere
  4. Oli Bartsch commented on patch set 13 02/10/22, 13:19

    Breaking-96812-NoFrontendTypoScriptBasedTemplateOverridesInTheBackend.rst:165

    This reads a bit like "should be / can be". Actually this breaks hard if not adapted: > Invalid service "dashboard.widget.t3blog": method "TYPO3\CMS\Dashboard\Widgets\RssWidget::__construct()" has no argument named "$view". Check your service definition. Even after removing the `$view` argument, I'm still not able to built the container due to following exception: > Invalid constructor argument 4 for service "dashboard.widget.t3blog": argument 3 must be defined before. Check your service definition. Note: dashboard.widget.t3blog is a custom widget which however behaves the same as e.g. the Core `dashboard.widget.t3news` widget. https://github.com/o-ba/custom_dashboard_widgets/blob/main/Configuration/Backend/Widgets/RssWidgets.yaml#L10
  5. Christian Kuhn commented on patch set 13 02/10/22, 14:37

    Breaking-96812-NoFrontendTypoScriptBasedTemplateOverridesInTheBackend.rst:165 Reply

    hmm. it *should* be b/w compatible if you don't change the services.yaml and widget class itself at all. that was the case for all core widgets.
  6. Christian Kuhn commented on patch set 13 02/10/22, 14:39

    Breaking-96812-NoFrontendTypoScriptBasedTemplateOverridesInTheBackend.rst:165 Reply

    It's basically that *if* you change the .yaml file, you *must* change the widget class, too. If you keep both as is, they'll work, but raise a deprecation entry at build-time ... at least that was the goal ... that does not work with custom_dashboard_widgets?
  7. Oli Bartsch commented on patch set 13 02/10/22, 15:09

    Breaking-96812-NoFrontendTypoScriptBasedTemplateOverridesInTheBackend.rst:165 Reply

    I could resolve the "Invalid constructor argument" exception However, for widgets, using a core widget classes, the `$view` argument MUST be omitted otherwise this leads to the mentioned: > Invalid service "dashboard.widget.t3blog": method "TYPO3\CMS\Dashboard\Widgets\RssWidget::__construct()" has no argument named "$view". Check your service definition.
  8. Oli Bartsch commented on patch set 13 02/10/22, 15:48

    BackendLayoutRenderer.php:189

    Should we move this at the top of the class?

    DashboardController.php:12

    In the dashboard module the "Add widget" button in the top right corner, as well as in the "info" on empty dashboards is currently missing the styles. Only add it here since I didn't find the reason on the first look.
  9. Christian Kuhn uploaded patch set 14 02/10/22, 17:23

  10. Christian Kuhn uploaded patch set 15 02/10/22, 17:25

  11. Stefan Bürk commented on patch set 15 02/10/22, 17:26

    Breaking-96812-NoFrontendTypoScriptBasedTemplateOverridesInTheBackend.rst:36

    is

    Breaking-96812-NoFrontendTypoScriptBasedTemplateOverridesInTheBackend.rst:44

    "leads to the" ?
  12. Christian Kuhn uploaded patch set 16 02/10/22, 17:27

  13. core-ci voted on patch set 15 V -1 02/10/22, 17:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23344

  14. core-ci voted on patch set 16 V -1 02/10/22, 17:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23345

  15. core-ci voted on patch set 14 V -1 02/10/22, 17:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23343

  16. Christian Kuhn commented on patch set 16 CR -1 02/10/22, 17:40

    working on comments.
  17. Christian Kuhn commented on patch set 16 02/10/22, 18:09

    Reply

    Done

    BackendLayoutRenderer.php:189 Reply

    yeah. at least before the protected methods. done.

    Breaking-96812-NoFrontendTypoScriptBasedTemplateOverridesInTheBackend.rst:36 Reply

    Done

    Breaking-96812-NoFrontendTypoScriptBasedTemplateOverridesInTheBackend.rst:44 Reply

    Done

    Breaking-96812-NoFrontendTypoScriptBasedTemplateOverridesInTheBackend.rst:83 Reply

    i'll use the number above, too ... basically to train people that "timestamp now" is unique enough ;)

    Breaking-96812-NoFrontendTypoScriptBasedTemplateOverridesInTheBackend.rst:115 Reply

    Done

    Breaking-96812-NoFrontendTypoScriptBasedTemplateOverridesInTheBackend.rst:165 Reply

    We solved that with a more b/w compatible approach now. I'll add a sentence about that.

    DashboardController.php:12 Reply

    Done
  18. Stefan Bürk commented on patch set 16 02/10/22, 18:09

    DashboardController.php:70

    This should be called after "$view = $this->modulTemplateFactory->create()". This will solve the issue Oliver noted with the missing styles on the add buttons. It seems that the difference is, that some basic css will get loaded later in the merged css instead before the needed dashboard css. So don't take this as "must" - maybe there is another way to ensure it is loaded after some basic css then.
  19. Christian Kuhn commented on patch set 16 02/10/22, 18:11

    DashboardController.php:70 Reply

    yeah. found same solution. will push in some minutes.
  20. Christian Kuhn uploaded patch set 17 02/10/22, 18:46

  21. core-ci voted on patch set 17 V +1 02/10/22, 18:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23348

  22. Stefan Bürk voted on patch set 17 V +1 CR +1 02/10/22, 19:45

  23. Benni Mack voted on patch set 17 CR +1 02/11/22, 12:57

  24. Benni Mack voted on patch set 17 V +2 CR +2 02/11/22, 13:19

  25. Benni Mack merged patch set 18 02/11/22, 13:19