Review main Ready for review

95431[TASK] Make most of the backend TypeScript null-safe

Benjamin Kott CR 0 V 0 Hard +204 −199 updated 11/20/26, 11:02

Commit message

Seventh step towards strictNullChecks, and the first that does not
finish its extension. What the backend still reports afterwards is a
long tail with no shared shape, better carried by a follow-up than
folded in here.

The bulk is what the other extensions showed as well. A lookup is
declared as if it always succeeds, a data attribute is read as a
string although a missing one yields undefined, an index is built from
a value that may not be there. Where the module owns the markup the
call now says so, where it does not the value is guarded.

Three things needed more than that. Parameters with a `null` default
declared a type that does not admit null, which every caller then had
to work around. The TypoScript stream parser modelled its scratch
state, its variable chain and its context chain as always present
although all three are initialised as null and walked until null - and
its combinators are pushed on a stack and invoked generically, so the
stack now says that rather than pretending to know their arguments.
The module menu read the top level TYPO3 object through an optional
chain and then asserted the result, which contradicts itself. The
absent object is now handled where it is read, so the exported menu
stays non-null for every module importing it.

The non-null assertions this step relies on are added with
strictNullChecks itself, as no-unnecessary-type-assertion reports
every such assertion until the option is enabled.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 10
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/31/95431/10 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/31/95431/10 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Relation chain 8

  1. main 95437[WIP][TASK] Enable strict mode for the TypeScript build Based on this change Work in progress Merge conflict Benjamin Kott CR 0 V 0 → 14.3 Easy +1 −9
  2. main 95436[WIP][TASK] Initialise class properties across the JavaScript stack Based on this change Work in progress Merge conflict Benjamin Kott CR 0 V 0 → 14.3 Hard +275 −275
  3. main 95435[WIP][TASK] Enable strictNullChecks for the TypeScript build Based on this change Work in progress Merge conflict Benjamin Kott CR 0 V 0 → 14.3 Nightmare +1822 −1817
  4. main 95434[WIP][TASK] Clear the last strictNullChecks errors in the backend Based on this change Work in progress Merge conflict Benjamin Kott CR 0 V -1 → 14.3 Normal +66 −60
  5. main 95433[WIP][TASK] Reduce the remaining backend strictNullChecks errors Based on this change Work in progress Merge conflict Benjamin Kott CR 0 V 0 → 14.3 Normal +63 −59
  6. main 95432[WIP][TASK] Carry the backend further towards strictNullChecks Based on this change Work in progress Merge conflict Benjamin Kott CR 0 V 0 → 14.3 Normal +57 −45
  7. 95431 [TASK] Make most of the backend TypeScript null-safe This change

  8. main 95430[TASK] Make the form editor null-safe This change is based on it Merged Benjamin Kott CR +2 V +2 → 14.3 Normal +91 −84

Merge conflicts 66

Issues 2

Files 86

Show 66 more files

Review log 1526

Show 1 earlier messages
  1. Benjamin Kott uploaded patch set 1 08/26/26, 13:09

  1. Benjamin Kott marked it work in progress 08/26/26, 13:24

  2. core-ci voted on patch set 1 V +1 08/26/26, 13:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107144

  3. Benjamin Kott uploaded patch set 2 V +1 10/15/26, 16:16

  4. core-ci voted on patch set 2 V +1 10/15/26, 16:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111233

  5. Benjamin Kott updated the commit message in patch set 3 V +1 10/15/26, 21:02

  6. core-ci voted on patch set 3 V +1 10/15/26, 21:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111274

  7. Benjamin Kott rebased onto patch set 4 V +1 10/16/26, 07:45

  8. core-ci voted on patch set 4 V -1 10/16/26, 08:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111322

  9. Benjamin Kott rebased onto patch set 5 V -1 10/16/26, 09:26

  10. core-ci voted on patch set 5 V -1 10/16/26, 10:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111337

  11. Benjamin Kott uploaded patch set 6 V -1 10/23/26, 14:49

  12. Benjamin Kott uploaded patch set 7 10/23/26, 15:42

  13. core-ci voted on patch set 6 V -1 10/23/26, 15:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112329

  14. core-ci voted on patch set 7 V -1 10/23/26, 16:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112349

  15. Benjamin Kott uploaded patch set 8 V -1 11/18/26, 10:59

  16. core-ci voted on patch set 8 V +1 11/18/26, 11:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114861

  17. Benjamin Kott uploaded patch set 9 V +1 11/19/26, 14:43

  18. core-ci voted on patch set 9 V -1 11/19/26, 14:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/115021

  19. Benjamin Kott commented on patch set 9 11/19/26, 14:58

    This change is ready for review.
  20. core-ci voted on patch set 9 V +1 11/19/26, 15:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/115021

  21. Georg Ringer commented on patch set 9 CR -1 11/19/26, 15:13

    so why do we got this comment. even though we use AI, the commit should not be a discussion board of AI
  22. Benjamin Kott commented on patch set 9 11/19/26, 15:27

    Reply

    not sure what your point is here, if we want to move forward in the chain, its important to know why this is here.
  23. Georg Ringer commented on patch set 9 CR 0 11/19/26, 15:32

    Reply

    ok, if you understand it, fine
  24. Garvin Hicking updated the commit message in patch set 10 V +1 11/20/26, 10:55

  25. core-ci voted on patch set 10 V +1 11/20/26, 11:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/115068