LearnNewsExamplesServices
Frontmatter
id8825
titleDocs: Document Scoped VDOM Update Rationale in VdomLifecycle
stateClosed
labels
documentationai
assigneestobiu
createdAtJan 20, 2026, 10:22 AM
updatedAtJan 20, 2026, 10:30 AM
githubUrlhttps://github.com/neomjs/neo/issues/8825
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 20, 2026, 10:30 AM

Docs: Document Scoped VDOM Update Rationale in VdomLifecycle

Closed v11.23.0 documentationai
tobiu
tobiu commented on Jan 20, 2026, 10:22 AM

The VdomLifecycle method hasUpdateCollision uses the < operator (e.g., distance < updateDepth) to determine if a child update should merge into a parent update. This logic is critical for enabling Scoped VDOM Updates, but its rationale has been a source of confusion for AI agents, leading to regression loops.

The Core Concept:

  • A Parent update with updateDepth: 1 produces a VDOM tree that only contains its own structure and reference nodes (placeholders) for its children. It explicitly prunes the child's subtree.
  • Therefore, a Parent (Depth 1) update and a Child update operate on disjoint sets of DOM nodes.
  • They do not collide.
  • They should not merge. They should run as independent, parallel updates for maximum performance.

The Task: Enhance the JSDoc for hasUpdateCollision (and potentially the class header of VdomLifecycle) to explicitly document this "Disjoint/Scoped Update" philosophy. Use the rationale provided above to clearly explain why 1 < 1 (False) is the correct and intended behavior for preserving parallelism. This will serve as a permanent knowledge anchor for future development.

tobiu added the documentation label on Jan 20, 2026, 10:22 AM
tobiu added the ai label on Jan 20, 2026, 10:22 AM
tobiu referenced in commit 060daaa - "docs: Document Scoped VDOM Update Rationale in VdomLifecycle (#8825)" on Jan 20, 2026, 10:29 AM
tobiu assigned to @tobiu on Jan 20, 2026, 10:30 AM
tobiu
tobiu Jan 20, 2026, 10:30 AM

Input from Gemini 3 Pro:

✦ I have enhanced the JSDoc for hasUpdateCollision in src/mixin/VdomLifecycle.mjs.

Documentation Update:

  • Explicitly documented the Scoped VDOM Update philosophy.
  • Clarified that at updateDepth: 1, the VDOM naturally contains unexpanded reference nodes for children.
  • Explained that this state ensures Parent and Child updates operate on disjoint DOM sets, making them collision-free and parallel-safe.
  • Confirmed that distance < updateDepth (e.g., 1 < 1 False) is the correct logic to enforcing this separation.

This serves as a definitive reference to prevent future regressions where agents might incorrectly assume collision at Depth 1.

tobiu closed this issue on Jan 20, 2026, 10:30 AM