Review 12.4 Merged

88638[BUGFIX] Fix race conditions in childnode querying custom elements

Benjamin Franzke CR +2 V +2 Normal +46 −23 updated 03/18/25, 08:43

Commit message

Children (or even succeeding siblings) of custom elements are not
guaranteed to be available by the time the element is added to the
DOM — i.e. when the connectedCallback() is triggered by the
browser, even when the components and their children are server
rendered, slow connections and streaming can cause initialization
race conditions. That means we must never assume that DOM
is fully loaded in connectedCallback. See #102550 for details.

In previous attempts (#102550, #102603) we made use of
HTML event bubbling and slotchange events to detect children, but these
solutions are profound and in parts fragile to master.
Therefore we use the DocumentService sledgehammer to make sure
we do not race during element initialization.

Review

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

Issues 3

Files 23

Show 3 more files

Review log 23

  1. Benjamin Franzke uploaded patch set 1 03/18/25, 08:23

  2. core-ci voted on patch set 1 V +1 03/18/25, 08:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75765

  3. Benjamin Franzke merged patch set 2 03/18/25, 08:43