Review main Merged

71395[BUGFIX] Fix PageRenderer->addRequireJsConfiguration from ext_localconf

Benjamin Franzke CR +2 V +2 Normal +47 −35 updated 10/01/21, 13:00

Commit message

TYPO3_REQUESTTYPE constants have been deprecated since #92947,
but PageRenderer->addRequireJsConfiguration() currently needs to be
scoped to BE context as the applicationType is derived
from the global TYPO3_REQUEST object since #92953.

This causes problems as the request object is not available during
ext_localconf.php loading, and is therefore always considered to be BE
 – also in FE, causing RequireJS to be always loaded, if PageRenderer
is configued via ext_localconf.php as possible in TYPO3 v10.

Therefore currently there is no longer a "supported" way to register
RequireJS configuration in ext_localconf.php.

This change delays RequireJs configuration loading and merging
until configuration is actually used, allowing configuration to be
registered anytime and without REQUESTTYPE conditions.
Also ApplicationType is evaluated on demand instead of during object
construction.

In TYPO3 v12 this should better be provided as an event that
allows to enhance the configuration, therefore add that as
todo to t3editor and rte_ckeditor which use the render-preProcess
hook right now, which works for them, but not for extensions
that need to register RequireJS configuration for the TYPO3
backend login screen.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Anja Leichsenring +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Anja Leichsenring +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 4

Files 4

Review log 1419

  1. Benjamin Franzke uploaded patch set 1 09/30/21, 22:04

  2. core-ci voted on patch set 1 V -1 09/30/21, 22:18 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17377

  3. Benjamin Franzke uploaded patch set 2 10/01/21, 04:26

  4. core-ci voted on patch set 2 V +1 10/01/21, 04:41 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17383

  5. Christian Kuhn commented on patch set 2 10/01/21, 08:30

    I'm not convinced here: General core strategy is to phase out ext_*. The hook usages work for our 2 extensions, I think we should use them and shouldn't foster ext_* usages here. What do you think?
  6. Benjamin Franzke commented on patch set 2 10/01/21, 08:36

    Reply

    Yea, fully agree on that. Though I think we still we need provide a way that works as in v10, if we don't have a proper new one. (which we can't add right now, due to feature freeze) I think we should provide a proper way in v12 using an event, but for now – if we are honest – we don't have *the* proper way (besides ext_localconf) to register requireJS configuration.
  7. Christian Kuhn commented on patch set 2 10/01/21, 08:52

    Reply

    Sure. We could still keep the hooks in v11 for the two extensions and change that to events in v12, right? The two usages would be a good use case for how-to change them to events in v12, then. I don't insist on this, just a thought ... If you prefer to look back to v10 in this area than to look forward to v12, I'll not block it, just asking if it's worth to change the two hooks to ext_* registration with this patch again.
  8. Benjamin Franzke uploaded patch set 3 10/01/21, 09:14

  9. Benjamin Franzke commented on patch set 3 10/01/21, 09:14

    Reply

    Ok, well, we can leave the hooks for core if we agree to add an event in v12, I'm fine with that. :+1: Done.
  10. core-ci voted on patch set 3 V +1 10/01/21, 09:28 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17391

  11. Christian Kuhn updated the commit message in patch set 4 10/01/21, 09:37

  12. Christian Kuhn voted on patch set 4 V +1 CR +1 10/01/21, 09:38

  13. core-ci voted on patch set 4 V +1 10/01/21, 09:51 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17395

  14. Anja Leichsenring updated the commit message in patch set 5 10/01/21, 12:37

  15. Christian Kuhn voted on patch set 5 V +1 CR +1 10/01/21, 12:37

  16. Anja Leichsenring voted on patch set 5 V +1 CR +1 10/01/21, 12:40

  17. core-ci voted on patch set 5 V +1 10/01/21, 12:52 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17424

  18. Benjamin Franzke voted on patch set 5 V +2 CR +2 10/01/21, 12:59

  19. Benjamin Franzke merged patch set 6 10/01/21, 13:00