LearnNewsExamplesServices
Frontmatter
id6993
titleCreate `Neo.component.mixin.VdomLifecycle`
stateClosed
labels
enhancement
assignees[]
createdAtJul 9, 2025, 12:52 PM
updatedAtJul 11, 2025, 2:06 AM
githubUrlhttps://github.com/neomjs/neo/issues/6993
authortobiu
commentsCount0
parentIssue6992
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJul 11, 2025, 2:06 AM

Create Neo.component.mixin.VdomLifecycle

Closed v10.0.0-beta.6 enhancement
tobiu
tobiu commented on Jul 9, 2025, 12:52 PM

1. Summary

Create a new mixin named Neo.mixin.VdomLifecycle. This mixin will encapsulate the core VDOM rendering engine logic currently located in Neo.component.Base. This is the foundational step for enabling the new functional component base class and for cleaning up the existing component architecture.

2. Rationale

The new reactivity layer introduced in v10, centered around Neo.core.Config and Neo.core.Effect, allows for a highly efficient and declarative component model. The src/button/Effect.mjs class serves as a proof-of-concept for this pattern, where a single Effect replaces dozens of imperative afterSet hooks.

This new, simpler component architecture relies on the ability to compose features using Mixins. With the recent enhancement enabling mixins to merge their static config into a consuming class, we can now create self-contained "feature mixins" (e.g., for VDOM management).

Extracting the VDOM logic from component.Base into Neo.mixin.VdomLifecycle is the foundational step. It will:

  • Improve code modularity and separation of concerns.
  • Slim down component.Base, making it easier to understand and maintain.
  • Provide a reusable piece of core machinery that can be used by the new FunctionalComponentBase without inheriting all of component.Base.

3. Scope & Implementation Plan

  1. Create File: Create a new file at src/mixin/VdomLifecycle.mjs.
  2. Identify & Move Logic: Move the properties and methods related to the VDOM rendering engine from src/component/Base.mjs into Neo.mixin.VdomLifecycle. The list of candidates we previously identified will be used as the basis for this refactoring.
  3. Refactor component.Base: Modify src/component/Base.mjs to use the new VdomLifecycle mixin, ensuring all existing functionality remains intact.

4. Definition of Done

  • Neo.mixin.VdomLifecycle is created and contains the extracted VDOM logic.
  • Neo.component.Base uses the new mixin.
  • All existing component-related tests pass without regression, confirming the refactoring is successful.
tobiu added parent issue #6992 on Jul 9, 2025, 12:52 PM
tobiu added the enhancement label on Jul 9, 2025, 12:52 PM
tobiu changed title from Create Neo.mixin.VdomLifecycle to Create Neo.component.mixin.VdomLifecycle on Jul 11, 2025, 2:04 AM
tobiu referenced in commit ac2b5b8 - "Create Neo.component.mixin.VdomLifecycle #6993" on Jul 11, 2025, 2:06 AM
tobiu closed this issue on Jul 11, 2025, 2:06 AM