Review main Merged Breaking

82267[!!!][FEATURE] Establish FE frontend.page.information attribute

Christian Kuhn CR +2 V +2 Expert +1143 −789 updated 12/23/23, 12:28

Commit message

The patch extracts TSFE->determineId() and its sub
methods from TSFE into TypoScriptFrontendInitialization
middleware.

The information created by these methods is modeled into
the new DTO PageInformation, which is added as
'frontend.page.information' request attribute before
handling other middlewares below. The non-internal old
properties within TSFE are set and kept as b/w compat
layer for now.

This is a powerful change: It allows us to reduce
dependencies to TSFE significantly, which we will
start to leverage with upcoming patches.

The patch is an intermediate change as such: Looking
at determineId() and its related methods makes clear
the code can benefit heavily from further refactoring.
The method could be ultimately extracted into
a service class that only returns the 'final'
PageInformation object, or throws exceptions for
'early' responses. To keep the patch reviewable at
this point, these refactorings will continue with
additional patches.

Detail notes:

* TSFE->sys_page PageRepository instance is for now
  modeled as (@internal) PageInformation->pageRepository.
  This can be refactored away later: Consumers should
  create instances of that class on demand.

* "original mount and shortcut page record" are also
  modeled as (@internal) PageInformation properties
  for now. They are internal handling since the redirects
  can only be created after TypoScript has been calculated
  later on, so the information has to be carried around
  for now. We *may* be able to change this later.

* The two middleware properties $pageNotFound and
  $pageAccessFailureHistory are a tribute to the current
  code flow in determineId(). They should be refactored
  away when the code is further shuffled around. The
  properties currently require a hack that needs to make
  the middleware "shared: false" to circumvent side
  effects in combination with error handling sub requests.

* The code flow around determineId() updates local state
  and state of PageInformation multiple times and is in
  general very hard to follow. The patch crafted this
  carefully and did not refactor the code flow heavily
  for now. Changing the early response creation strategy
  will make the code flow much more straightforward
  later.

* determineId() and with it the PageInformation object
  is now created *before* TSFE is instantiated, shifting
  the instantiation to a slightly later point.

* getPageAccessFailureReasons() is for now transferred
  to the middleware as well. It can be later dissolved
  when determineId() receives further refactoring. Two
  consumers (indirectly) by ShortcutAndMountPointRedirect
  middleware could be dissolved already, so the method could
  be removed from TSFE.

* TSFE->linkVars needs to be dissolved soon: The strategy
  should be to create "linkVars" on demand within the
  link handling code and eventually encapsulate it with
  a runtime cache entry.

* getRedirectUriForMountPoint() and getRedirectUriForShortcut()
  are relocated to ShortcutAndMountPointRedirect
  middleware. TSFE->getUriToCurrentPageForRedirect() had
  to be made (@internal) public to do that, but that method
  can be refactored away when TSFE->linkVars is dissolved.

* The hacks within RedirectService are extended to deal
  with the new situation for now. The entire thing needs
  to fall at a later point completely.

* Further patches should start avoiding the TSFE properties
  that are now set as b/w compat layer, and start using
  the PageInformation request attribute instead. This will
  reduce overall dependencies to TSFE significantly.

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 14

Review log 1831

Show 36 earlier messages
  1. Christian Kuhn uploaded patch set 1 12/21/23, 16:36

  2. core-ci voted on patch set 1 V -1 12/21/23, 16:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50866

  3. Christian Kuhn uploaded patch set 2 V -1 12/21/23, 16:53

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

  5. Christian Kuhn uploaded patch set 3 V -1 12/21/23, 18:14

  6. core-ci voted on patch set 3 V -1 12/21/23, 18:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50871

  1. Christian Kuhn uploaded patch set 4 V -1 12/22/23, 10:48

  2. core-ci voted on patch set 4 V -1 12/22/23, 10:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50900

  3. Christian Kuhn uploaded patch set 5 V -1 12/22/23, 11:03

  4. core-ci voted on patch set 5 V +1 12/22/23, 11:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50901

  5. Christian Kuhn uploaded patch set 6 V +1 12/22/23, 12:17

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

  7. Christian Kuhn uploaded patch set 7 V +1 12/22/23, 14:24

  8. core-ci voted on patch set 7 V +1 12/22/23, 14:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50906

  9. Christian Kuhn uploaded patch set 8 V +1 12/22/23, 15:21

  10. Christian Kuhn updated the commit message in patch set 9 12/22/23, 15:26

  11. core-ci voted on patch set 8 V +1 12/22/23, 15:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50907

  12. core-ci voted on patch set 9 V +1 12/22/23, 15:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50908

  13. Christian Kuhn updated the commit message in patch set 10 V +1 12/22/23, 15:36

  14. Christian Kuhn updated the commit message in patch set 11 12/22/23, 15:39

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

  16. core-ci voted on patch set 11 V +1 12/22/23, 15:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50910

  17. Christian Kuhn commented on patch set 11 CR -1 12/22/23, 16:03

    working on minor details
  18. Christian Kuhn uploaded patch set 12 CR -1 V +1 12/22/23, 16:24

  19. core-ci voted on patch set 12 V +1 12/22/23, 16:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50911

  20. Benni Mack uploaded patch set 13 V +1 12/22/23, 21:29

  21. Benni Mack commented on patch set 13 CR +1 V +1 12/22/23, 21:29

    excellent work
  22. core-ci voted on patch set 13 V +1 12/22/23, 21:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50912

  23. Stefan Bürk commented on patch set 13 CR +1 V +1 12/23/23, 12:26

    amazing - thanks for the hard work
  24. Christian Kuhn voted on patch set 13 CR +2 V +2 12/23/23, 12:28

  25. Christian Kuhn merged patch set 14 12/23/23, 12:28