LearnNewsExamplesServices
Frontmatter
id6941
titleImplement Class-Aware Merging for Nested Configs via Dynamic `Neo.mergeConfig` Replacement
stateOpen
labels
enhancementno auto close
assignees[]
createdAtJul 4, 2025, 7:43 PM
updatedAtOct 3, 2025, 11:11 AM
githubUrlhttps://github.com/neomjs/neo/issues/6941
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]

Implement Class-Aware Merging for Nested Configs via Dynamic Neo.mergeConfig Replacement

Openenhancementno auto close
tobiu
tobiu commented on Jul 4, 2025, 7:43 PM

Is your feature request related to a problem? Please describe. The current Neo.mergeConfig method treats all objects as generic JavaScript objects, lacking the ability to perform intelligent, class-aware merging for nested configurations that represent instantiable Neo.mjs classes (i.e., objects containing className, module, or ntype properties). This limitation means that when a subclass provides a configuration for a nested component that extends a component defined in a superclass, the merging process may not correctly respect the inheritance hierarchy, leading to suboptimal or unexpected results (e.g., a simple replacement instead of a deep, inheritance-aware merge).

Describe the solution you'd like The proposed solution involves implementing a more advanced mergeConfig logic within a dedicated manager (e.g., Neo.manager.ClassHierarchy or a new Neo.manager.Config). This advanced implementation will leverage Neo.manager.ClassHierarchy's isA method to understand the inheritance relationships between classes represented by nested config objects. Once this manager is instantiated and ready (early in the framework's bootstrap process), it will dynamically replace the existing Neo.mergeConfig method with its own, more powerful version. This ensures that all subsequent config processing benefits from intelligent, class-aware merging, allowing for proper inheritance-based merging of nested component configurations.

Describe alternatives you've considered Attempting to implement this complex class-aware merging directly within the static Neo.mergeConfig method would introduce significant coupling and complexity into the core Neo module. Centralizing this logic within a manager that has access to the class hierarchy provides a cleaner, more maintainable, and extensible solution.

Additional context This enhancement is a crucial architectural step towards a more robust and intuitive config system, particularly for applications with deep component hierarchies and extensive use of inheritance. It will significantly improve the predictability and correctness of how nested component configurations are merged across the class chain.

tobiu added the enhancement label on Jul 4, 2025, 7:43 PM
tobiu removed the stale label on Oct 3, 2025, 11:11 AM
tobiu added the no auto close label on Oct 3, 2025, 11:11 AM
tobiu cross-referenced by #8230 on Dec 31, 2025, 3:24 PM