Review main Merged Breaking

75537[!!!][TASK] Remove jQuery in PersistentStorage

Andreas Kienast CR +2 V +2 Hard +149 −104 updated 09/09/22, 15:41

Commit message

All requests are changed to use the AJAX API. Due to this, the return
type of some methods is changed, resulting in a breaking change.

There is one exception: due to how the PersistentStorage module is
designed, the private method `loadFromServer()` send a synchronous
request to the server. In the long run, this must become an asynchronous
request but requires more refactorings as this affects all consumers.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Oli Bartsch +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Oli Bartsch +1
    • Andreas Kienast +1
    • core-ci +1 CI

Issues 1

Files 11

Review log 2026

Show 1 earlier messages
  1. Andreas Kienast uploaded patch set 1 08/23/22, 14:01

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

  2. Andreas Kienast rebased onto patch set 2 08/24/22, 06:21

  3. core-ci voted on patch set 2 V +1 08/24/22, 06:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30400

  4. Andreas Kienast uploaded patch set 3 08/25/22, 05:50

  5. core-ci voted on patch set 3 V +1 08/25/22, 05:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30432

  6. Benjamin Franzke commented on patch set 3 CR -1 08/25/22, 12:19

    persistent.ts:51

    docblock doesn't match the real return type declaration.

    persistent.ts:70

    hm.. mixing async/await and .then() in one method feels strange. can we do const response = await new AjaxRequest(..) return await this.resolveResponse(response) instead. (The mixture is so confusing for me, that I'm not even sure whether my example above is correct, but I think it should be)
  7. Benjamin Franzke commented on patch set 3 08/25/22, 12:47

    persistent.ts:37

    Hm, I think this won't work. value will `undefined` for the first invocation of Persistent.get(), as there is no blocking in this.loadFromServer().
  8. Andreas Kienast commented on patch set 3 08/25/22, 15:05

    persistent.ts:37 Reply

    That's true. The whole class is very special, making refactorings hard here.

    persistent.ts:70 Reply

    This doesn't work. AjaxRequest().get() returns a promise which is resolved via then(), which takes the response as an AjaxResponse object.
  9. Benjamin Franzke commented on patch set 3 08/25/22, 15:13

    persistent.ts:37 Reply

    yup, without making .get() an asynchronous function (which would add new problems for its users for sure), we really have to use plain XMLHttpRequest with async: false if we want to replace jQuery here, since only XMLHttpRequest supports a synchronous mode, while fetch() doesn't allow that.
  10. Andreas Kienast uploaded patch set 4 08/26/22, 07:08

  11. Andreas Kienast uploaded patch set 5 08/26/22, 07:10

  12. core-ci voted on patch set 5 V +1 08/26/22, 07:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30453

  13. core-ci voted on patch set 4 V +1 08/26/22, 07:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30452

  14. Benjamin Franzke uploaded patch set 6 09/08/22, 15:46

  15. Benjamin Franzke commented on patch set 6 09/08/22, 15:46

    persistent.ts:37 Reply

    Thanks for adapting to XMLHttpRequest.

    persistent.ts:51 Reply

    Done

    persistent.ts:70 Reply

    ok, but following works: const response = await new AjaxRequest(..).post() return this.resolveResponse(response) Adapted the code, hope that's fine.
  16. Andreas Kienast commented on patch set 6 09/08/22, 15:52

    persistent.ts:131

    Is there a reasoning for the one-time variable?
  17. core-ci voted on patch set 6 V +1 09/08/22, 15:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30837

  18. Andreas Kienast voted on patch set 6 V +1 09/08/22, 15:55

  19. Benjamin Franzke commented on patch set 6 09/08/22, 16:18

    persistent.ts:131 Reply

    well, probably the missing IDE on my side, wanted to make it explicit, that we need synchronous operation.
  20. Andreas Kienast commented on patch set 6 09/08/22, 16:20

    persistent.ts:131 Reply

    Ack
  21. Oli Bartsch voted on patch set 6 V +1 CR +1 09/08/22, 17:39

  22. Benjamin Franzke voted on patch set 6 V +2 CR +2 09/09/22, 07:00

  23. Benjamin Franzke merged patch set 7 09/09/22, 07:00

  24. Lina Wolf commented on patch set 7 09/09/22, 15:33

  25. Andreas Kienast commented on patch set 7 09/09/22, 15:41

    Reply

    No, why do you think so?