Review 12.4 Merged

80991[TASK] Prune global TypeScript types

Benjamin Franzke CR +2 V +2 Hard +179 −121 updated 09/13/23, 11:14

Commit message

* Only define type definitions via "types"
  that need to be globally available.
  See  https://www.typescriptlang.org/tsconfig#types
  > If `types` is specified, only packages listed will
  > be included in the global scope

  Those whose exports are (and can be) imported locally
  are *not* included globally bot only explicitly via
  `import` by the typescript modules that make actually
  use of these dependencies.

* Move declarations from global into local scope that were
  actually only defined and used in specific files (draguploader)
  or move to inline code (disablePagingAction)
  or replace by modern code ($.escapeSelector => CSS.escape)

* Remove unnecessary `declare module` statements that
  shadowed type definitions that are avaiable right now:
  * This means muuri is now type checked, which revealed
    wrong usage in the dashboard grid and is fixed right away.

* Remove `any` where possible and use actual types instead

Left for later cleanups are:

* The ckeditor5-bundle should ideally be written in TypeScript
  to avoid the need for a handcrafted .d.ts file and the bundle
  itself would be compile time type-checked.

* chart.js flatpickr and shortcut-buttons-flatpickr usage should be
  adapted to allow their natively provided types to kick it, but that
  needs upstream fixes for shortcut-buttons-flatpickr first and we
  need to stop mapping flatpickr and chart.js to pseudo package names.

Review

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

Issues 1

Files 27

Show 7 more files

Review log 23

  1. Benjamin Franzke uploaded patch set 1 09/13/23, 11:03

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

  3. Benjamin Franzke merged patch set 2 09/13/23, 11:14