Review main Merged

73027[TASK] Convert all static RequireJS calls to native ES6 modules

Benjamin Franzke CR +2 V +2 Hard +190 −179 updated 02/15/22, 11:34

Commit message

All static RequireJS calls (static string argument) are migrated to
native ES6 modules.

Excluded is CodeMirrorElement which still needs RequireJS to be
available for loading CodeMirror and it's modules. CodeMirror
migration to ES6 will be a separate step by upgrading from v5 to v6.

Manual modifications in Form/Element/AbstractFormElement.php to keep
JavaScriptModule flags for registerCustomEvaluation call-conversions.
Also JavaScriptRenderer.php to is patched always include
the EXT:core importmap whenever the JavaScriptItemHandler is used
(required for the dependency to "JavaScriptItemProcessor.js").

All other changes have been performed with the following commands:

  git grep -l "loadRequireJsModule('TYPO3/CMS" | \
    grep -v /Documentation/Changelog | \
    grep -v ActionMenuViewHelper.php | \
    xargs sed -i '/CodeMirrorElement/!'"s/->loadRequireJsModule('\\(TYPO3\/CMS\/[^']*\\)')/->loadJavaScriptModule('\\1.js')/g"

  git grep -l "JavaScriptModuleInstruction::forRequireJS('TYPO3/CMS" | \
    grep -v /Documentation/Changelog | \
    grep -v JavaScriptRendererTest.php | \
    xargs sed -i '/CodeMirrorElement/!'"s/JavaScriptModuleInstruction::forRequireJS('\\(TYPO3\/CMS\/[^']*\\)'/JavaScriptModuleInstruction::create('\\1.js'/g"

  git grep -l "JavaScriptModuleInstruction::forRequireJS($" | \
    grep -v /Documentation/Changelog | \
    grep -v Form/Element/AbstractFormElement.php | \
    xargs sed -i -e '/CodeMirrorElement/!s/::forRequireJS/::create/' -e "s/^\([ ]*\)'\\(TYPO3\/CMS\/[^']*\\)'/\\1'\\2.js'/g"

  sed -i "s/'\\(TYPO3\/CMS\/[^']*\\)'/'\\1.js'/g" typo3/sysext/backend/Tests/Functional/Form/MfaInfoElementTest.php

  # Same migration as already started in #96607
  git grep -l includeRequireJsModules= | \
    grep -v /Documentation/Changelog/ | \
    grep -v PageRendererViewHelper.php | \
    xargs sed -i \
      -e 's/includeRequireJsModules=/includeJavaScriptModules=/' \
      -e "s/\\([0-9]: *'TYPO3\\/CMS\\/.*\\)'/\\1.js'/g"

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Benni Mack +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Benni Mack +1
    • core-ci +1 CI

Issues 3

Files 81

Show 61 more files

Review log 1728

Show 23 earlier messages
  1. Benjamin Franzke uploaded patch set 1 01/14/22, 23:40

  2. core-ci voted on patch set 1 V -1 01/15/22, 00:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22105

  3. Benjamin Franzke uploaded patch set 2 01/15/22, 00:48

  1. core-ci voted on patch set 2 V -1 01/15/22, 01:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22107

  2. Benjamin Franzke uploaded patch set 3 01/15/22, 01:28

  3. Benjamin Franzke uploaded patch set 4 01/15/22, 01:40

  4. core-ci voted on patch set 3 V -1 01/15/22, 01:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22110

  5. core-ci voted on patch set 4 V -1 01/15/22, 01:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22112

  6. Benjamin Franzke uploaded patch set 5 02/08/22, 06:03

  7. Benjamin Franzke commented on patch set 5 CR -1 02/08/22, 06:15

    todo: also adapt typo3/sysext/beuser/Resources/Private/Templates/Permission/Edit.html
  8. core-ci voted on patch set 5 V -1 02/08/22, 06:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23186

  9. Benjamin Franzke uploaded patch set 6 02/08/22, 06:45

  10. core-ci voted on patch set 6 V +1 02/08/22, 07:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23188

  11. Benjamin Franzke uploaded patch set 7 02/08/22, 07:00

  12. core-ci voted on patch set 7 V -1 02/08/22, 07:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23189

  13. Benjamin Franzke uploaded patch set 8 02/08/22, 11:09

  14. core-ci voted on patch set 8 V +1 02/08/22, 11:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23203

  15. Benjamin Franzke uploaded patch set 9 02/13/22, 10:58

  16. core-ci voted on patch set 9 V +1 02/13/22, 11:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23478

  17. Benjamin Franzke uploaded patch set 10 02/14/22, 10:56

    Rebase
  18. core-ci voted on patch set 10 V +1 02/14/22, 11:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23504

  19. Benjamin Franzke uploaded patch set 11 02/14/22, 13:37

    Resolve Merge Conflict
  20. core-ci voted on patch set 11 V +1 02/14/22, 13:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23513

  21. Benni Mack commented on patch set 11 V +1 CR +1 02/14/22, 15:26

    I have an issue in EXT:form backend module (Uncaught SyntaxError: missing ) after argument list), but I guess this is unrelated to this patch.
  22. Georg Ringer commented on patch set 11 02/15/22, 07:21

    works fine for me, also in ext:form
  23. Benjamin Franzke commented on patch set 11 02/15/22, 08:19

    Reply

    yea, talked to Benni via Slack. Thae issue he saw was triggered by local modification of a composer library in his installation.
  24. Georg Ringer voted on patch set 11 V +2 CR +2 02/15/22, 11:34

  25. Georg Ringer merged patch set 12 02/15/22, 11:34