Review 13.4 Merged

88525[TASK] Use verbatim TypeScript module syntax

Benjamin Franzke CR +2 V +2 Hard +423 −438 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
  • Verified V +2 Done
    • Benjamin Franzke +2
    • core-ci +1 CI

Issues 1

Files 223

Show 203 more files

Review log 35

  1. Benjamin Franzke commented on patch set 1 03/07/25, 08:50

    Cherry Picked from branch main. The following files contain Git conflicts: * Build/Sources/TypeScript/backend/ajax-data-handler.ts * Build/Sources/TypeScript/backend/form-engine-review.ts * Build/Sources/TypeScript/backend/recordlist.ts
  2. core-ci voted on patch set 1 V -1 03/07/25, 08:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75279

  3. Benjamin Franzke uploaded patch set 2 V -1 03/07/25, 08:59

  4. core-ci voted on patch set 2 V +1 03/07/25, 09:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75281

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