LearnNewsExamplesServices
Frontmatter
id8467
titleCentralize and Enforce Stable VDOM IDs in VdomLifecycle
stateClosed
labels
airefactoringcore
assigneestobiu
createdAtJan 9, 2026, 2:59 PM
updatedAtJan 9, 2026, 3:01 PM
githubUrlhttps://github.com/neomjs/neo/issues/8467
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 9, 2026, 3:01 PM

Centralize and Enforce Stable VDOM IDs in VdomLifecycle

Closed v11.19.1 airefactoringcore
tobiu
tobiu commented on Jan 9, 2026, 2:59 PM

Consolidate the stable ID assignment logic (id and __wrapper) into a single method ensureStableIds() within Neo.mixin.VdomLifecycle. This method will be invoked during initVnode(), updateVdom(), and afterSetId() to ensure components always maintain globally unique and stable VDOM IDs, even if their vdom objects are replaced at runtime. This removes redundancy and prevents potential collisions in ComponentManager.wrapperNodes.

tobiu added the ai label on Jan 9, 2026, 2:59 PM
tobiu added the refactoring label on Jan 9, 2026, 2:59 PM
tobiu added the core label on Jan 9, 2026, 2:59 PM
tobiu referenced in commit 5d069da - "refactor: centralize and enforce stable VDOM IDs in VdomLifecycle (#8467)" on Jan 9, 2026, 3:00 PM
tobiu assigned to @tobiu on Jan 9, 2026, 3:01 PM
tobiu
tobiu Jan 9, 2026, 3:01 PM

Input from Gemini 3 Pro:

✦ ✦ I have centralized the stable VDOM ID logic into Neo.mixin.VdomLifecycle.

Changes

  • New Method: Added ensureStableIds() to VdomLifecycle.mjs. This method is the single source of truth for assigning me.id and __wrapper IDs to the VDOM tree.
  • Enforcement: ensureStableIds() is now called at the beginning of initVnode() and updateVdom(). This makes the system robust even if a component's vdom object is replaced entirely at runtime.
  • Refactoring: Updated Component.Base#afterSetId() to call the centralized method, removing redundant logic.

All "AutoId" unit tests passed.

Commit: 5d069da7a (#8467)

tobiu closed this issue on Jan 9, 2026, 3:01 PM
tobiu cross-referenced by #8469 on Jan 9, 2026, 4:17 PM