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
- Create File: Create a new file at
src/mixin/VdomLifecycle.mjs.
- 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.
- 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.
1. Summary
Create a new mixin named
Neo.mixin.VdomLifecycle. This mixin will encapsulate the core VDOM rendering engine logic currently located inNeo.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.ConfigandNeo.core.Effect, allows for a highly efficient and declarative component model. Thesrc/button/Effect.mjsclass serves as a proof-of-concept for this pattern, where a singleEffectreplaces dozens of imperativeafterSethooks.This new, simpler component architecture relies on the ability to compose features using Mixins. With the recent enhancement enabling mixins to merge their
static configinto a consuming class, we can now create self-contained "feature mixins" (e.g., for VDOM management).Extracting the VDOM logic from
component.BaseintoNeo.mixin.VdomLifecycleis the foundational step. It will:component.Base, making it easier to understand and maintain.FunctionalComponentBasewithout inheriting all ofcomponent.Base.3. Scope & Implementation Plan
src/mixin/VdomLifecycle.mjs.src/component/Base.mjsintoNeo.mixin.VdomLifecycle. The list of candidates we previously identified will be used as the basis for this refactoring.component.Base: Modifysrc/component/Base.mjsto use the newVdomLifecyclemixin, ensuring all existing functionality remains intact.4. Definition of Done
Neo.mixin.VdomLifecycleis created and contains the extracted VDOM logic.Neo.component.Baseuses the new mixin.