Review main Merged

81810[TASK] Remove jQuery from @typo3/backend/recordlist

Andreas Nedbal CR +2 V +2 Normal +36 −34 updated 11/24/23, 10:45

Commit message

Review

  • Code review CR +2 Done
    • Andreas Nedbal +2
    • Christian Kuhn +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Andreas Nedbal +2
    • Christian Kuhn +1
    • Andreas Kienast +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 2432

Show 57 earlier messages
  1. Andreas Nedbal uploaded patch set 1 11/20/23, 18:51

  2. core-ci voted on patch set 1 V +1 11/20/23, 18:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49183

  3. Oli Bartsch commented on patch set 1 CR -1 11/21/23, 08:56

    recordlist.ts:113

    Can we be more explicit here?

    recordlist.ts:114

    Might break in case "target" does not exist. Suggest to use "target?.dataset"

    recordlist.ts:119

    Might break in case "collapseIcon" does not exist. Suggest to use "collapseIcon?.dataset"

    recordlist.ts:218

    Please use either an empty string or the 'disabled' string, see https://www.w3.org/TR/2008/WD-html5-20080610/semantics.html#boolean

    recordlist.ts:239

    Please add some check for element existence here. Plain JS behaves different than jQuery find() and friends, which do such checks internally.
  4. Andreas Nedbal uploaded patch set 2 CR -1 V +1 11/21/23, 09:21

  5. core-ci voted on patch set 2 V +1 11/21/23, 09:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49204

  6. Andreas Nedbal commented on patch set 2 11/21/23, 09:27

    recordlist.ts:113 Reply

    The targets here are generally div elements, so using plain HTMLElement as type should be fine

    recordlist.ts:114 Reply

    Done

    recordlist.ts:119 Reply

    Done

    recordlist.ts:218 Reply

    Done

    recordlist.ts:239 Reply

    I added some additional checks, but generally this relies on existing (and mandatory) structure of recordlist panels. Where it makes sense I added existence checks and also cleaned up the row element list to remove empty/null elements.
  7. Andreas Kienast commented on patch set 2 CR -1 11/22/23, 09:35

    recordlist.ts:215

    nopenopenopenope

    recordlist.ts:216

    `currentTarget` does not exist.

    recordlist.ts:246

    Why is this required?

    recordlist.ts:251

    `tableElement.querySelector('tbody tr') === null` is a bit faster
  1. Andreas Nedbal uploaded patch set 3 CR -1 V +1 11/22/23, 10:07

  2. Andreas Nedbal commented on patch set 3 11/22/23, 10:09

    recordlist.ts:215 Reply

    Done

    recordlist.ts:216 Reply

    Done

    recordlist.ts:246 Reply

    Removes anything that's null or false-y from the list, eliminates the need to do null checks for both elements in the initial querySelector. (technically, only `rowElement` would be removed anyway, as a spread empty array is nothing) Could add a comment to make that behaviour more obvious.

    recordlist.ts:251 Reply

    Done
  3. core-ci voted on patch set 3 V +1 11/22/23, 10:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49329

  4. Andreas Kienast commented on patch set 3 11/22/23, 10:27

    recordlist.ts:246 Reply

    I'd rather do something like ``` const rowElements = translatedRowElements; if (rowElement !== null) { rowElements.unshift(rowElement); } ``` This safes a callback that potentially removes only one element at max.
  5. Andreas Kienast commented on patch set 3 11/22/23, 11:10

    recordlist.ts:246 Reply

    Alternative: ``` [rowElement, ...translatedRowElements].forEach((rowElement: HTMLElement|null): void => { rowElement?.remove(); });```
  6. Andreas Nedbal uploaded patch set 4 V +1 11/23/23, 13:24

  7. core-ci voted on patch set 4 V +1 11/23/23, 13:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49683

  8. Andreas Nedbal commented on patch set 4 11/23/23, 13:43

    recordlist.ts:246 Reply

    Done
  9. Andreas Kienast commented on patch set 4 CR -1 11/24/23, 08:34

    on it

    recordlist.ts:114 Reply

    Please do not put null safe operators everywhere! We're rebuilding jQuery-behavior here and real errors may get hidden.
  10. Andreas Kienast uploaded patch set 5 CR -1 V +1 11/24/23, 08:38

  11. Andreas Kienast voted on patch set 5 CR +1 V +1 11/24/23, 08:38

  12. core-ci voted on patch set 5 V +1 11/24/23, 08:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49843

  13. Jochen Roth uploaded patch set 6 CR +1 V +1 11/24/23, 09:52

  14. Jochen Roth voted on patch set 6 CR +1 V +1 11/24/23, 09:54

  15. Christian Kuhn voted on patch set 6 CR +1 V +1 11/24/23, 10:25

  16. Andreas Kienast voted on patch set 6 CR +1 V +1 11/24/23, 10:28

  17. core-ci voted on patch set 6 V -1 11/24/23, 10:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49864

  18. Jochen Roth uploaded patch set 7 CR +1 V +1 11/24/23, 10:33

  19. Andreas Kienast uploaded patch set 8 11/24/23, 10:33

  20. core-ci voted on patch set 7 V +1 11/24/23, 10:41 Copied votes on follow-up patch sets have been updated: * Verified+1 has been copied to patch set 8 (copy condition: "changekind:NO_CHANGE"). Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49872

  21. Andreas Kienast voted on patch set 8 CR +1 V +1 11/24/23, 10:42

  22. Christian Kuhn voted on patch set 8 CR +1 V +1 11/24/23, 10:43

  23. core-ci voted on patch set 8 V +1 11/24/23, 10:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49873

  24. Andreas Nedbal voted on patch set 8 CR +2 V +2 11/24/23, 10:45

  25. Andreas Nedbal merged patch set 9 11/24/23, 10:45