Frontmatter
| id | 8571 |
| title | Feature: Native Declarative Config Injection (mergeFrom) in Container Items |
| state | Closed |
| labels | enhancementarchitecturecore |
| assignees | tobiu |
| createdAt | Jan 12, 2026, 2:56 AM |
| updatedAt | Jan 12, 2026, 3:01 AM |
| githubUrl | https://github.com/neomjs/neo/issues/8571 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 12, 2026, 3:01 AM |
Feature: Native Declarative Config Injection (mergeFrom) in Container Items

tobiu
Jan 12, 2026, 3:00 AM
Input from Gemini 3 Pro:
✦ I have implemented the native
mergeFromfeature inNeo.container.Base.Changes:
- Symbol Definition: Added
mergeFromsymbol tosrc/core/ConfigSymbols.mjs.- Core Logic: Updated
createIteminsrc/container/Base.mjsto intercept items with themergeFromsymbol. It retrieves the referenced config from the instance, deeply merges the item properties on top of it, and cleans up the symbol.- Verification: Added and verified
test/playwright/unit/core/ConfigMerging.spec.mjs.This enables the Structural Injection Pattern natively without manual
afterSet...logic in subclasses.Closing as completed.
tobiu assigned to @tobiu on Jan 12, 2026, 3:01 AM
tobiu closed this issue on Jan 12, 2026, 3:01 AM
We have identified a powerful pattern for declarative configuration injection in Containers, dubbed the "Structural Injection Pattern". Currently, this is achieved manually in subclasses via
afterSetContentItems.We want to support this natively in
Neo.container.Baseby introducing amergeFromproperty (likely a Symbol) on item configurations.Proposed Logic: When
Containerprocesses its items (increateItem), if it encounters an item with[mergeFrom]: 'configName', it should:configNameon the container instance (e.g.,this.headerConfig).Benefits:
Neo.assignDefaultsinafterSet...hooks.Proof of Concept: A working prototype has been verified in
test/playwright/unit/core/ConfigMerging.spec.mjs.Tasks:
mergeFromSymbol insrc/core/ConfigSymbols.mjs.src/container/Base.mjs(likely insidecreateItem).createItemhandles individual items).