Review main Merged

88248[TASK] Use verbatim TypeScript module syntax

Benjamin Franzke CR +2 V +2 Hard +424 −439 updated 03/07/25, 10:10

Commit message

The TypeScript verbatim module syntax (available since TypeScript 5.0)
makes TypeScript import elision explicit instead of implicit by never
dropping import statements that import types only, allowing to
import from modules with side effects without the risk that TypeScript
might optimize the import away.

One of such "useful" side effects are web components, given following
Example:

```
// Module import './my-component' would be optimized
// "away" by TypeScript, because only a type was imported.
// with tsconfig option "verbatimModuleSyntax: false"
import { MyComponentType } from './my-component'

const el: MyComponentType = mydocument.createElement('my-component');
```

With `verbatimModuleSyntax` enabled the above code results in an error
and we have two options:

```
// Option 1) Import type and preserve the module import
import { type MyComponentType } from './my-component'

// Option 2) Import type and drop the module import
import type { MyComponentType } from './my-component'
```

In this case the desired option is 1) since we want the import of
the module `./my-component` to be preserved, as we need to load the
module to register the web component that is provided as a side-effect
(custom elements registry).

See https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax for
more information.

Review

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

Issues 1

Files 222

Show 202 more files

Review log 1322

  1. Benjamin Franzke uploaded patch set 1 02/17/25, 10:34

  2. core-ci voted on patch set 1 V +1 02/17/25, 10:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74249

  3. Benjamin Franzke rebased onto patch set 2 V +1 02/20/25, 07:24

  4. core-ci voted on patch set 2 V +1 02/20/25, 07:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74442

  5. Benjamin Franzke uploaded patch set 3 V +1 03/04/25, 11:38

  6. Benjamin Franzke updated the commit message in patch set 4 03/04/25, 11:43

  7. core-ci voted on patch set 3 V -1 03/04/25, 11:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75096

  8. core-ci voted on patch set 4 V -1 03/04/25, 11:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75097

  9. Benjamin Franzke uploaded patch set 5 V -1 03/04/25, 11:50

  10. core-ci voted on patch set 5 V +1 03/04/25, 11:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75098

  11. Benjamin Franzke uploaded patch set 6 V +1 03/05/25, 03:18

  12. core-ci voted on patch set 6 V +1 03/05/25, 03:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75119

  13. Benjamin Franzke uploaded patch set 7 V +1 03/05/25, 10:11

    Rebase
  14. core-ci voted on patch set 7 V +1 03/05/25, 10:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75152

  15. Simon Schaufelberger updated the commit message in patch set 8 V +1 03/05/25, 11:28

  16. core-ci voted on patch set 8 V +1 03/05/25, 11:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75157

  17. Benjamin Franzke uploaded patch set 9 V +1 03/05/25, 13:02

    Rebase
  18. core-ci voted on patch set 9 V +1 03/05/25, 13:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75172

  19. Benni Mack voted on patch set 9 CR +1 V +1 03/06/25, 13:27

  20. Andreas Kienast voted on patch set 9 CR +1 V +1 03/07/25, 08:49

  21. Benjamin Franzke voted on patch set 9 CR +2 V +2 03/07/25, 08:50

  22. Benjamin Franzke merged patch set 10 03/07/25, 10:10