Review main Merged Breaking

82522[!!!][FEATURE] Avoid TSFE->config['config']

Christian Kuhn CR +2 V +2 Expert +1365 −744 updated 06/18/26, 23:10

Commit message

Frontend TypoScript has two special details, next to
'configuration' ("constants") and 'setup'.

First, there is the determined "PAGE" object that depends
on type / typeNum. It allows to render multiple different
variants of a pages content. Historically, this has often
been a "print" view, nowadays, this is usually a "json"
variant, or some XML for sitemaps.

A frontend is not rendered without a proper PAGE object.
The FE rendering chain determines the given 'type' and maps
it to a configured PAGE with this 'typeNum', defaulting
to zero '0'.
The patch models the determined PAGE object to the Request
attribute 'FrontendTypoScript' now, which is used by FE
RequestHandler to manage rendering of this PAGE type.

Second special thing is 'config' TypoScript as top-level
'config' settings. Those can be overridden by the specific
PAGE object (often 'page.config'). A typical use case is
'json.config.disableAllHeaderCode = 1'.
This "merged" 'config' array has been available as
TSFE->config['config'] before. The patch makes the merged
config available in the 'FrontendTypoScript' object as
well, available in the Request object as
'frontend.typoscript' attribute.

The patch adapts all usages of TSFE->config['config'] to
the attribute.

There is a special quirk with 'config': This part of
TypoScript 'setup' is so important, that it needs to be
available in 'fully cached page' scenarios as well, to
for instance decide if a content-length header should be
added to the response.
This has been the reason 'config' has been cached along
with page cache content in 'page' cache before.
The patch changes this and adds dedicated cache entries
for 'merged config' in the (file based) 'typoscript' cache.
This reduces page cache size a bit and allows re-using
these 'config' cache accross different pages when they
are identical, which is determined by the cache identifiers.

All these changes are logical follow-ups to the TypoScript
parser that has been implemented with v12.
They pave the way to extract TypoScript calculation from
TypoScriptFrontendController with upcoming patches.

Next to this refactoring, the existing hooks in this area
had to fall, especially to get rid of their dependency to
"pObj" TypoScriptFrontendController. They are mostly
substituted by new events, details are documented with the
.rst files and class comments.

The patch reduces usages of $GLOBALS['TSFE'] and usages
of TypoScriptFrontendController in general.

$GLOBALS['TSFE']->config['config'] is still available as
b/w compat layer (a dedicated deprecation will follow),
but core usages have been removed. This became a bit
complicated with TimeTrackerInitialization and
WorkspacePreview middlewares: Both are run before the
final TypoScript 'config' is determined, so they do
not have that attribute attached to their incoming
Request. But they still need to know TS 'config'
details to decide on details *after* calling lower handle()
middlewares. They by now accessed $GLOBALS['TSFE'], which
is (still) set by a lower middleware. To avoid this
indirect state usage, these middlewares now register an event
listener that is dispatched after TypoScript 'config' has been
determined, and set local state to know if they should add
additional Response data.

Review

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

Issues 1

Files 48

Show 28 more files

Review log 61111

Show 4586 earlier messages
  1. Christian Kuhn uploaded patch set 1 01/20/24, 11:18

  2. core-ci voted on patch set 1 V +1 01/20/24, 11:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51840

  3. Christian Kuhn uploaded patch set 2 V +1 01/21/24, 12:46

  4. core-ci voted on patch set 2 V -1 01/21/24, 12:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51889

  5. Christian Kuhn uploaded patch set 3 V -1 01/21/24, 14:30

  6. core-ci voted on patch set 3 V -1 01/21/24, 14:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51891

  7. Christian Kuhn uploaded patch set 4 V -1 01/21/24, 15:23

  8. core-ci voted on patch set 4 V +1 01/21/24, 15:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51892

  9. Christian Kuhn uploaded patch set 5 V +1 01/21/24, 15:33

  10. core-ci voted on patch set 5 V -1 01/21/24, 15:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51893

  11. Christian Kuhn uploaded patch set 6 V -1 01/21/24, 16:34

  12. Christian Kuhn uploaded patch set 7 01/21/24, 16:35

  13. core-ci voted on patch set 7 V +1 01/21/24, 16:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51895

  14. Christian Kuhn uploaded patch set 8 V +1 01/22/24, 10:22

  15. core-ci voted on patch set 8 V +1 01/22/24, 10:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51919

  16. Christian Kuhn uploaded patch set 9 V +1 01/22/24, 10:57

  17. core-ci voted on patch set 9 V -1 01/22/24, 11:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51920

  18. Christian Kuhn uploaded patch set 10 V -1 01/22/24, 11:57

  19. Christian Kuhn rebased onto patch set 11 01/22/24, 11:57

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

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

  22. Christian Kuhn updated the commit message in patch set 12 V +1 01/22/24, 12:04

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

  24. Christian Kuhn uploaded patch set 13 V +1 01/22/24, 12:53

  25. core-ci voted on patch set 13 V -1 01/22/24, 12:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51933

  26. Christian Kuhn uploaded patch set 14 V -1 01/22/24, 13:05

  27. core-ci voted on patch set 14 V +1 01/22/24, 13:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51934

  28. Christian Kuhn uploaded patch set 15 V +1 01/22/24, 13:25

  29. core-ci voted on patch set 15 V -1 01/22/24, 13:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51935

  30. Christian Kuhn uploaded patch set 16 V -1 01/22/24, 13:35

  31. core-ci voted on patch set 16 V +1 01/22/24, 13:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51936

  32. Christian Kuhn uploaded patch set 17 V +1 01/22/24, 13:54

  33. core-ci voted on patch set 17 V +1 01/22/24, 14:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51937

  34. Christian Kuhn uploaded patch set 18 V +1 01/22/24, 14:49

  35. core-ci voted on patch set 18 V +1 01/22/24, 14:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51939

  36. Christian Kuhn uploaded patch set 19 V +1 01/22/24, 15:00

  37. core-ci voted on patch set 19 V +1 01/22/24, 15:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51942

  38. Christian Kuhn uploaded patch set 20 V +1 01/22/24, 15:14

  39. core-ci voted on patch set 20 V +1 01/22/24, 15:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51943

  40. Christian Kuhn uploaded patch set 21 V +1 01/23/24, 11:42

  41. core-ci voted on patch set 21 V +1 01/23/24, 11:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51991

  42. Christian Kuhn uploaded patch set 22 V +1 01/23/24, 15:28

  43. core-ci voted on patch set 22 V +1 01/23/24, 15:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52010

  44. Christian Kuhn uploaded patch set 23 V +1 01/23/24, 16:01

  45. core-ci voted on patch set 23 V +1 01/23/24, 16:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52012

  46. Christian Kuhn uploaded patch set 24 V +1 01/23/24, 16:13

  47. Christian Kuhn uploaded patch set 25 01/23/24, 16:18

  48. core-ci voted on patch set 25 V -1 01/23/24, 16:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52015

  49. core-ci voted on patch set 24 V +1 01/23/24, 16:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52013

  50. Christian Kuhn uploaded patch set 26 V -1 01/24/24, 13:56

  51. core-ci voted on patch set 26 V +1 01/24/24, 14:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52081

  52. Christian Kuhn uploaded patch set 27 V +1 01/24/24, 14:35

  53. core-ci voted on patch set 27 V +1 01/24/24, 14:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52085

  54. Christian Kuhn uploaded patch set 28 V +1 01/24/24, 15:03

  55. core-ci voted on patch set 28 V -1 01/24/24, 15:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52088

  56. Christian Kuhn uploaded patch set 29 V -1 01/24/24, 15:23

  57. Christian Kuhn rebased onto patch set 30 01/24/24, 15:25

  58. core-ci voted on patch set 30 V +1 01/24/24, 15:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52091

  59. core-ci voted on patch set 29 V +1 01/24/24, 15:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52090

  60. Christian Kuhn uploaded patch set 31 V +1 01/24/24, 16:19

  61. core-ci voted on patch set 31 V -1 01/24/24, 16:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52099

  62. Christian Kuhn uploaded patch set 32 V -1 01/24/24, 16:30

  63. core-ci voted on patch set 32 V +1 01/24/24, 16:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52100

  64. Christian Kuhn uploaded patch set 33 V +1 01/24/24, 16:43

  65. core-ci voted on patch set 33 V -1 01/24/24, 16:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52102

  66. Christian Kuhn uploaded patch set 34 V -1 01/24/24, 17:27

  67. Christian Kuhn uploaded patch set 35 01/24/24, 17:27

  68. core-ci voted on patch set 35 V -1 01/24/24, 17:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52105

  69. Christian Kuhn uploaded patch set 36 V -1 01/24/24, 17:36

  70. core-ci voted on patch set 36 V -1 01/24/24, 17:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52107

  71. Christian Kuhn uploaded patch set 37 V -1 01/24/24, 18:01

  72. core-ci voted on patch set 37 V +1 01/24/24, 18:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52108

  73. Christian Kuhn uploaded patch set 38 V +1 01/25/24, 12:58

  74. core-ci voted on patch set 38 V +1 01/25/24, 13:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52176

  75. Christian Kuhn uploaded patch set 39 V +1 01/25/24, 13:33

  76. core-ci voted on patch set 39 V +1 01/25/24, 13:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52181

  77. Christian Kuhn uploaded patch set 40 V +1 01/25/24, 13:44

  78. core-ci voted on patch set 40 V -1 01/25/24, 13:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52182

  79. Christian Kuhn uploaded patch set 41 V -1 01/25/24, 14:29

  80. core-ci voted on patch set 41 V +1 01/25/24, 14:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52185

  81. Christian Kuhn uploaded patch set 42 V +1 01/25/24, 15:19

  82. core-ci voted on patch set 42 V +1 01/25/24, 15:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52186

  83. Christian Kuhn uploaded patch set 43 V +1 01/25/24, 15:31

  84. core-ci voted on patch set 43 V +1 01/25/24, 15:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52189

  85. Christian Kuhn uploaded patch set 44 V +1 01/25/24, 15:42

  86. Christian Kuhn uploaded patch set 45 01/25/24, 15:52

  1. core-ci voted on patch set 44 V -1 01/25/24, 16:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52190

  2. Christian Kuhn uploaded patch set 46 01/25/24, 16:44

  3. Christian Kuhn uploaded patch set 47 01/25/24, 16:47

  4. Christian Kuhn uploaded patch set 48 01/25/24, 16:52

  5. core-ci voted on patch set 46 V -1 01/25/24, 16:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52195

  6. core-ci voted on patch set 45 V -1 01/25/24, 16:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52191

  7. core-ci voted on patch set 48 V +1 01/25/24, 16:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52197

  8. Christian Kuhn uploaded patch set 49 V +1 01/25/24, 18:09

  9. Christian Kuhn updated the commit message in patch set 50 01/25/24, 18:12

  10. Christian Kuhn updated the commit message in patch set 51 01/25/24, 18:16

  11. core-ci voted on patch set 49 V +1 01/25/24, 18:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52200

  12. core-ci voted on patch set 50 V +1 01/25/24, 18:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52201

  13. core-ci voted on patch set 51 V +1 01/25/24, 18:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52202

  14. Christian Kuhn uploaded patch set 52 V +1 01/25/24, 18:34

  15. core-ci voted on patch set 52 V +1 01/25/24, 18:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52203

  16. Benni Mack commented on patch set 52 CR +1 01/25/24, 22:25

    impressive. thanks
  17. Stefan Bürk commented on patch set 52 CR +1 01/25/24, 23:29

    again. great work, thx.
  18. Christian Kuhn uploaded patch set 53 CR +1 V +1 01/26/24, 08:34

  19. Benni Mack voted on patch set 53 CR +1 V +1 01/26/24, 08:35

  20. core-ci voted on patch set 53 V +1 01/26/24, 08:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52216

  21. Stefan Bürk voted on patch set 53 CR +1 V +1 01/26/24, 09:07

  22. Christian Kuhn voted on patch set 53 CR +2 V +2 01/26/24, 09:13

  23. Christian Kuhn merged patch set 54 01/26/24, 09:13

  24. Benjamin Franzke commented on patch set 54 01/30/24, 14:41

    Note: I'm currently updating https://github.com/bnf/nginx_cache for v13.0 and will leave some comments regarding breaking stuff (not mentioned or insufficient replacements here). (I do not complain, I just want them to be mentioned, so we can work on alternatives when doing the subsequent refactorings)

    StateUtility.php:55

    Removal is breaking and not mentioned/detected.

    Breaking-102932-RemovedTypoScriptFrontendControllerHooks.rst:19 Unresolved

    Usecases for this Hook: Extensions providing cache-proxy integration (like EXT:nginx_cache) With the mentioned alternatives I found following problems: * There is no access to TSFE cache expiry (of the cache content that was loaded from cache) * Ordering against `PrepareTypoScriptFrontendRendering` is @internal * `AfterTypoScriptDeterminedEvent` does not provide context to request (and semantically is strange to be used, if you are interested in the case that page was loaded from cache) * `TSFE->pageContentWasLoadedFromCache` (protected) needs to be accessed to get to know whether the page was actually read from cache (that's what the previous hook said). Alternative: `TSFE->isGeneratePage()` – but that is `@internal`
  25. Benjamin Franzke commented on patch set 54 01/30/24, 14:42

    StateUtility.php:55 Reply Unresolved

    (marking unresolved)