LearnNewsExamplesServices
Frontmatter
id7710
titleRefactor `vnodeInitialized` to a Reactive Config in `VdomLifecycle`
stateClosed
labels
enhancementairefactoring
assigneestobiu
createdAtNov 6, 2025, 1:49 PM
updatedAtNov 6, 2025, 1:50 PM
githubUrlhttps://github.com/neomjs/neo/issues/7710
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtNov 6, 2025, 1:50 PM

Refactor vnodeInitialized to a Reactive Config in VdomLifecycle

Closed v11.0.0 enhancementairefactoring
tobiu
tobiu commented on Nov 6, 2025, 1:49 PM

The vnodeInitialized property was incorrectly defined as a non-reactive config in Neo.component.Base and manually managed with getters, setters, and event firing. This created an inconsistent and fragile implementation.

This refactoring corrected the issue by:

  1. Moving the definition of vnodeInitialized to the VdomLifecycle mixin, its logical owner.
  2. Converting it to a proper reactive config (vnodeInitialized_) with a trailing underscore.
  3. Adding an afterSetVnodeInitialized hook within the mixin to handle the vnodeInitialized event firing automatically.
  4. Removing the obsolete non-reactive config, getter, and setter from Neo.component.Base.
  5. Updating onInitVnode() and syncVnodeTree() to use the new reactive setter (this.vnodeInitialized = true) instead of manually manipulating the private property and firing events.

This change centralizes the logic, improves code clarity, and aligns the implementation with Neo.mjs best practices for reactive state management.

tobiu added the enhancement label on Nov 6, 2025, 1:49 PM
tobiu added the ai label on Nov 6, 2025, 1:49 PM
tobiu added the refactoring label on Nov 6, 2025, 1:49 PM
tobiu assigned to @tobiu on Nov 6, 2025, 1:49 PM
tobiu referenced in commit 80863fe - "Refactor vnodeInitialized to a Reactive Config in VdomLifecycle #7710" on Nov 6, 2025, 1:50 PM
tobiu closed this issue on Nov 6, 2025, 1:50 PM