Review main Merged

83179[TASK] Add FrontendTypoScriptFactory

Christian Kuhn CR +2 V +2 Expert +1021 −682 updated 03/19/24, 14:35

Commit message

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.

Review

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

Issues 4

Files 34

Show 14 more files

Review log 2343

Show 918 earlier messages
  1. Christian Kuhn uploaded patch set 1 03/03/24, 12:34

  2. core-ci voted on patch set 1 V -1 03/03/24, 12:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53788

  3. Christian Kuhn uploaded patch set 2 V -1 03/03/24, 15:03

  4. core-ci voted on patch set 2 V -1 03/03/24, 15:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53794

  5. Christian Kuhn uploaded patch set 3 V -1 03/03/24, 15:58

  6. core-ci voted on patch set 3 V -1 03/03/24, 16:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53795

  7. Christian Kuhn uploaded patch set 4 V -1 03/13/24, 08:29

  8. core-ci voted on patch set 4 V -1 03/13/24, 08:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54459

  9. Christian Kuhn uploaded patch set 5 V -1 03/14/24, 07:27

  10. Christian Kuhn uploaded patch set 6 03/14/24, 07:31

  11. core-ci voted on patch set 5 V -1 03/14/24, 07:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54511

  12. core-ci voted on patch set 6 V -1 03/14/24, 07:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54512

  13. Christian Kuhn uploaded patch set 7 V -1 03/14/24, 10:12

  14. core-ci voted on patch set 7 V -1 03/14/24, 10:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54521

  15. Christian Kuhn uploaded patch set 8 V -1 03/15/24, 08:11

  16. core-ci voted on patch set 8 V -1 03/15/24, 08:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54565

  17. Christian Kuhn uploaded patch set 9 V -1 03/15/24, 09:52

  18. core-ci voted on patch set 9 V -1 03/15/24, 09:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54573

  1. Christian Kuhn uploaded patch set 10 V -1 03/15/24, 10:44

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

  3. Christian Kuhn uploaded patch set 11 V -1 03/15/24, 11:48

  4. core-ci voted on patch set 11 V +1 03/15/24, 11:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54586

  5. Christian Kuhn uploaded patch set 12 V +1 03/15/24, 15:08

  6. Christian Kuhn uploaded patch set 13 03/15/24, 15:09

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

  8. core-ci voted on patch set 12 V -1 03/15/24, 15:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54594

  9. core-ci voted on patch set 13 V +1 03/16/24, 07:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54595

  10. core-ci voted on patch set 12 V -1 03/16/24, 07:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54594

  11. Christian Kuhn uploaded patch set 14 V +1 03/16/24, 10:16

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

  13. Christian Kuhn uploaded patch set 15 V +1 03/16/24, 12:22

  14. core-ci voted on patch set 15 V +1 03/16/24, 12:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54622

  15. Christian Kuhn uploaded patch set 16 V +1 03/17/24, 09:23

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

  17. Christian Kuhn uploaded patch set 17 V +1 03/17/24, 10:35

  18. Christian Kuhn updated the commit message in patch set 18 03/17/24, 10:40

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

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

  21. Christian Kuhn commented on patch set 18 03/19/24, 12:11

    PrepareTypoScriptFrontendRendering.php:179

    we may want to test $response instanceof serverRequestInterface and errorController() here if not set, to prevent a possible php error. i'll adapt with next patch.
  22. Stefan Bürk voted on patch set 18 CR +1 V +1 03/19/24, 13:07

  23. Garvin Hicking commented on patch set 18 CR +1 V +1 03/19/24, 14:27

    Great refactoring on this beast :-)
  24. Christian Kuhn voted on patch set 18 CR +2 V +2 03/19/24, 14:35

  25. Christian Kuhn merged patch set 19 03/19/24, 14:35