Skip to content
Snippets Groups Projects
  1. Apr 03, 2024
  2. Apr 02, 2024
  3. Mar 31, 2024
  4. Mar 30, 2024
  5. Mar 29, 2024
  6. Mar 26, 2024
  7. Mar 25, 2024
  8. Mar 23, 2024
  9. Mar 22, 2024
  10. Mar 21, 2024
  11. Mar 20, 2024
  12. Mar 19, 2024
    • Christian Kuhn's avatar
      [TASK] Add FrontendTypoScriptFactory · 5712a422
      Christian Kuhn authored
      In version 12, the introduction of the new TypoScript parser
      was accompanied by the implementation of factories for
      PageTsConfig and UserTsConfig.
      A factory for Frontend TypoScript has not been added,
      though: Frontend TypoScript creation ended up in
      TSFE->getFromCache(). At this point, establishing a proper
      factory was unfeasible due to the numerous dependencies of
      TypoScript creation to TSFE internals.
      
      With recent refactorings around TSFE, coupled with lots of
      state now being represented as request attributes, it's now
      possible to decompose getFromCache() and establish a
      FrontendTypoScriptFactory.
      
      getFromCache() is a complex beast: It influences Frontend
      rendering performance a lot, and tries to trigger the least
      amount of calculations, especially in 'fully cached pages'
      context. This results in high required complexity due to
      lots of state with diverse cross dependencies.
      
      The method composes of three main steps:
      1. Bootstrap TypoScript setting ("constants") and calculate
         setup condition verdicts. This creates required TypoScript
         related state needed to calculate the page cache identifier.
      2. Access page cache, lock page rendering if needed, and see
         if a possible page cache content contains uncached ("_INT")
         sections.
      3. Calculate at least setup "config." depending on given
         type/typeNum, but create full TypoScript setup if a cached
         page contains uncached sections or could not be retrieved
         from cache.
      
      The patch extracts parts 1 and 3 to FrontendTypoScriptFactory.
      Part 2 is moved into PrepareTypoScriptFrontendRendering
      middleware.
      
      This approach allowed these related refactorings:
      * The release of rendering locks is now consolidated within the
        PrepareTypoScriptFrontendRendering middleware. This guarantees
        locks are released, even in scenarios where lower middleware
        components encounter errors. This addresses an issue where
        locks retained during crashes, leading to deadlock situations
        in subsequent requests.
      * Dependencies to TSFE within ext:redirects RedirectService
        are reduced, and it no longer locks page rendering.
      * The Extbase BackendConfigurationManager utilizes the new
        factory, eliminating the need for its own implementation.
      
      The patch unlocks further refactorings: It especially allows
      removing the cache related properties from TSFE by representing
      them as request attributes. Subsequent patches will address this
      task accordingly.
      
      Resolves: #103410
      Related: #97816
      Related: #98914
      Related: #102932
      Releases: main
      Change-Id: I7fd158cffeebe6b2c64e0e3595284b8780fb73cf
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83179
      
      
      Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
      Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
      Reviewed-by: default avatarGarvin Hicking <gh@faktor-e.de>
      Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Tested-by: default avatarGarvin Hicking <gh@faktor-e.de>
      Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
      5712a422