Review main Merged

73025[TASK] Support FLAG_USE_TOP_WINDOW for ESM instructions

Benjamin Franzke CR +2 V +2 Normal +99 −9 updated 01/22/22, 19:23

Commit message

Implement top-frame-module loading for ES6 modules.
With RequireJS we could simply invoke top.require(), but
for native ES modules and dynamic import() statements
top.import() is not possible, as import is not a function
but a statement, and therefore not invokable on `top.`.

This has been marked as todo in #96510 as it is a
non trivial change that is better implemented in a
separately testable patch.

An event is used that is dispatched on the top document.
It is filled by a global event handler with a promise
that reveals the result of the import() statement
performed in the context of the top frame.

Top frame module loading is used when modals
or notifications are shown in the outer-frame,
therefore EXT:redirect and EXT:install are adapted
to make use of this feature and avoid the prior
RequireJS indirection.

Review

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

Issues 3

Files 12

Review log 1216

  1. Benjamin Franzke uploaded patch set 1 01/14/22, 23:00

  2. core-ci voted on patch set 1 V +1 01/14/22, 23:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22103

  3. Benjamin Franzke uploaded patch set 2 01/21/22, 13:35

  4. core-ci voted on patch set 2 V -1 01/21/22, 13:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22354

  5. Christian Kuhn commented on patch set 2 01/21/22, 13:53

    This looks cool, but I don't really understand the impact. This means JS modules are no longer loaded within the modules iframe, but loaded into the top frame instead? Does that mean, when I click the redirects module a second time, the module is not fetched a second time? Why is that triggered within ext:redirects with this one-liner change? I think it may help to just explain a bit more within the commit message - more tailored for people like me who are not that deep within the esm stuff ;) Note regarding install tool: Testing the patch means testing the standalone install tool as well.
  6. Benjamin Franzke commented on patch set 2 01/21/22, 13:57

    Reply

    will explain. This is for cases where the inner frame does stuff in the outer frame, like: * presenting a modal in the outer frame which requires "new" dependencies (in general that's quite ugly, but that's what we have for the system-maintainers modal when rendered inside the backend module) * presenting a notification in the outer frame For all other cases and regular imports this isn't used.
  7. Benjamin Franzke voted on patch set 2 CR -1 01/21/22, 14:07

  8. Benjamin Franzke uploaded patch set 3 01/21/22, 14:22

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

    Reply

    Done
  10. core-ci voted on patch set 3 V +1 01/21/22, 14:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22356

  11. Benni Mack voted on patch set 3 V +1 CR +1 01/21/22, 20:21

  12. Benni Mack updated the commit message in patch set 4 01/21/22, 21:32

  13. Benni Mack voted on patch set 4 V +1 CR +1 01/21/22, 21:32

  14. core-ci voted on patch set 4 V +1 01/21/22, 21:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22381

  15. Christian Kuhn voted on patch set 4 V +2 CR +2 01/22/22, 19:23

  16. Christian Kuhn merged patch set 5 01/22/22, 19:23