Review main Merged

93304[TASK] Turn PageRenderer into a data sink

Christian Kuhn CR +2 V +2 Hard +458 −340 updated 03/24/26, 18:46

Commit message

The stateful, injectable singleton god object 'PageRenderer'
is responsible for gathering HTML body snippets, head data,
JS resources, body tag, title tag, meta tags, everything, in
both Frontend and Backend to create the Response in the end.

This construct haunts us since TYPO3 v4. The FE works in v14
related to TSFE removal finally opened options to tame this
construct. The underlying issue in FE rendering is that
ContentObjectRenderer only takes care of body strings from
content objects. Everything else a content object needs to
do its job in FE has to be registered off-track using
PageRenderer.

The basic idea is to dissolve this conflict: TYPO3 v15 could
establish a 'return data object' for content objects, allowing
to declare their body string plus everything else they need
(js, meta tags, ...), including cache instructions.
Even fluid could return such an object directly if needed.
A central service could then merge those data objects,
and could take care of cache details along the way, and
create the Response from a collection of such objects in
the end.
Such a structure is similar to an Action-Domain-Responder [1],
it currently looks as if this could be a viable option at least
in FE in order to dissolve most issues we have with the
PageRenderer singleton at the moment.

Whatever the final fate of PageRenderer will be, all works in
this area will be much easier in TYPO3 v15 if we turn the current
PageRenderer into a data sink only, as opposed to a data sink
combined with a data source. It will allow us to come up with
a relatively simple b/w compat layer in v15 when we took care that
'arbitrary' consumers can no longer retrieve any given state from
PageRenderer at any given point during the rendering process.

To prepare that, this patch deprecates almost all 'getters'
from PageRenderer: Data is supposed to be hand over to
PageRenderer, but not retrieved from it. This can be done
with most methods quite easily. Some harder details:

* PageRenderer->getDocType() is used by core and various
  extensions to determine if a created HTML tag should be
  self closing: With HTML5, the ending '/' is omitted, with
  XHTML strict it needs to be there. This is not an issue in
  BE, which is HTML5. Luckily, this information can be derived
  from FE TypoScript (which is attached to Request in FE)
  instead. The deprecation RsT documents an example.
* PageRenderer->getJavaScriptRenderer(). JavaScriptRenderer
  is a sub-construct of PageRenderer mainly relevant in BE.
  The patch does not touch this construct for now.
* The patch surfaces that YoutubeRenderer and VimeoRenderer
  have a dependency to Request (again via DocType) without
  the Request being hand over. We accept a fallback to
  $GLOBALS['TYPO3_REQUEST'] for now, and add a @todo
  documenting the API should be changed.

[1] https://en.wikipedia.org/wiki/Action%E2%80%93domain%E2%80%93responder

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Helmut Hummel +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Helmut Hummel +1
    • core-ci +1 CI

Issues 1

Files 26

Show 6 more files

Review log 2240

Show 815 earlier messages
  1. Christian Kuhn uploaded patch set 1 03/22/26, 11:15

  2. core-ci voted on patch set 1 V -1 03/22/26, 11:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98382

  3. Christian Kuhn uploaded patch set 2 V -1 03/23/26, 11:18

  4. Christian Kuhn uploaded patch set 3 03/23/26, 11:24

  5. core-ci voted on patch set 2 V -1 03/23/26, 11:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98457

  6. Christian Kuhn uploaded patch set 4 03/23/26, 11:44

  7. Christian Kuhn uploaded patch set 5 03/23/26, 12:07

  8. core-ci voted on patch set 3 V -1 03/23/26, 12:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98459

  9. core-ci voted on patch set 4 V -1 03/23/26, 12:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98463

  10. Christian Kuhn uploaded patch set 6 03/23/26, 12:40

  11. core-ci voted on patch set 6 V -1 03/23/26, 12:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98478

  12. core-ci voted on patch set 5 V -1 03/23/26, 12:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98471

  13. Christian Kuhn uploaded patch set 7 V -1 03/23/26, 13:05

  14. Christian Kuhn uploaded patch set 8 03/23/26, 13:12

  15. core-ci voted on patch set 7 V -1 03/23/26, 13:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98480

  1. core-ci voted on patch set 8 V -1 03/23/26, 13:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98482

  2. Christian Kuhn uploaded patch set 9 V -1 03/23/26, 14:13

  3. core-ci voted on patch set 9 V -1 03/23/26, 14:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98488

  4. Christian Kuhn uploaded patch set 10 V -1 03/23/26, 14:41

  5. core-ci voted on patch set 10 V -1 03/23/26, 14:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98491

  6. Christian Kuhn uploaded patch set 11 V -1 03/23/26, 15:07

  7. Christian Kuhn uploaded patch set 12 03/23/26, 15:15

  8. Christian Kuhn uploaded patch set 13 03/23/26, 15:24

  9. core-ci voted on patch set 11 V -1 03/23/26, 15:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98497

  10. core-ci voted on patch set 13 V +1 03/23/26, 15:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98503

  11. core-ci voted on patch set 12 V -1 03/23/26, 15:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98499

  12. Christian Kuhn updated the commit message in patch set 14 V +1 03/23/26, 17:27

  13. core-ci voted on patch set 14 V -1 03/23/26, 17:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98518

  14. core-ci voted on patch set 14 V +1 03/23/26, 18:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98518

  15. Christian Kuhn uploaded patch set 15 V +1 03/24/26, 09:52

  16. Christian Kuhn uploaded patch set 16 03/24/26, 10:29

  17. core-ci voted on patch set 16 V +1 03/24/26, 10:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98567

  18. core-ci voted on patch set 15 V -1 03/24/26, 10:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98559

  19. Christian Kuhn uploaded patch set 17 V +1 03/24/26, 11:54

  20. core-ci voted on patch set 17 V +1 03/24/26, 12:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98581

  21. Helmut Hummel voted on patch set 17 CR +1 V +1 03/24/26, 14:45

  22. Christian Kuhn commented on patch set 17 03/24/26, 18:27

    Got a 'fine by reading' by benni in voice, too.
  23. Stefan Bürk voted on patch set 17 CR +1 V +1 03/24/26, 18:45

  24. Christian Kuhn voted on patch set 17 CR +2 V +2 03/24/26, 18:45

  25. Christian Kuhn merged patch set 18 03/24/26, 18:46