[TASK] Add FrontendTypoScriptFactory
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:Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Garvin Hicking <gh@faktor-e.de> Tested-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
core-ci <typo3@b13.com> Tested-by:
Garvin Hicking <gh@faktor-e.de> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch>
Showing
- typo3/sysext/core/Classes/TypoScript/FrontendTypoScript.php 114 additions, 24 deletionstypo3/sysext/core/Classes/TypoScript/FrontendTypoScript.php
- typo3/sysext/core/Classes/TypoScript/FrontendTypoScriptFactory.php 473 additions, 0 deletions...ext/core/Classes/TypoScript/FrontendTypoScriptFactory.php
- typo3/sysext/core/Classes/TypoScript/IncludeTree/Visitor/IncludeTreeSetupConditionConstantSubstitutionVisitor.php 2 additions, 2 deletions.../IncludeTreeSetupConditionConstantSubstitutionVisitor.php
- typo3/sysext/core/Configuration/Services.yaml 10 additions, 0 deletionstypo3/sysext/core/Configuration/Services.yaml
- typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php 9 additions, 39 deletions...ase/Classes/Configuration/BackendConfigurationManager.php
- typo3/sysext/extbase/Tests/Functional/Configuration/FrontendConfigurationManagerTest.php 3 additions, 3 deletions...tional/Configuration/FrontendConfigurationManagerTest.php
- typo3/sysext/extbase/Tests/Functional/Mvc/Controller/ActionControllerArgumentTest.php 1 addition, 1 deletion...unctional/Mvc/Controller/ActionControllerArgumentTest.php
- typo3/sysext/extbase/Tests/Functional/Mvc/Web/RequestBuilderTest.php 1 addition, 1 deletion...t/extbase/Tests/Functional/Mvc/Web/RequestBuilderTest.php
- typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Storage/Typo3DbBackendTest.php 1 addition, 1 deletion...tional/Persistence/Generic/Storage/Typo3DbBackendTest.php
- typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Storage/Typo3DbQueryParserTest.php 20 additions, 20 deletions...al/Persistence/Generic/Storage/Typo3DbQueryParserTest.php
- typo3/sysext/extbase/Tests/Functional/Persistence/TranslationTest.php 1 addition, 1 deletion.../extbase/Tests/Functional/Persistence/TranslationTest.php
- typo3/sysext/extbase/Tests/Functional/Persistence/WorkspaceTest.php 2 additions, 2 deletions...xt/extbase/Tests/Functional/Persistence/WorkspaceTest.php
- typo3/sysext/extbase/Tests/Unit/Configuration/FrontendConfigurationManagerTest.php 5 additions, 5 deletions...s/Unit/Configuration/FrontendConfigurationManagerTest.php
- typo3/sysext/fluid/Tests/Functional/ViewHelpers/CObjectViewHelperTest.php 0 additions, 7 deletions...id/Tests/Functional/ViewHelpers/CObjectViewHelperTest.php
- typo3/sysext/fluid/Tests/Functional/ViewHelpers/FormViewHelperTest.php 1 addition, 1 deletion...fluid/Tests/Functional/ViewHelpers/FormViewHelperTest.php
- typo3/sysext/fluid/Tests/Functional/ViewHelpers/Link/ActionViewHelperTest.php 2 additions, 2 deletions...ests/Functional/ViewHelpers/Link/ActionViewHelperTest.php
- typo3/sysext/fluid/Tests/Functional/ViewHelpers/Link/PageViewHelperTest.php 2 additions, 2 deletions.../Tests/Functional/ViewHelpers/Link/PageViewHelperTest.php
- typo3/sysext/fluid/Tests/Functional/ViewHelpers/Uri/ActionViewHelperTest.php 1 addition, 1 deletion...Tests/Functional/ViewHelpers/Uri/ActionViewHelperTest.php
- typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php 19 additions, 492 deletions...ntend/Classes/Controller/TypoScriptFrontendController.php
- typo3/sysext/frontend/Classes/Event/ShouldUseCachedPageDataIfAvailableEvent.php 4 additions, 2 deletions...Classes/Event/ShouldUseCachedPageDataIfAvailableEvent.php
Please register or sign in to comment