LearnNewsExamplesServices
Frontmatter
id6972
titleEnhance `createHierarchicalDataProxy` to Support Reactive Non-Leaf Nodes
stateOpen
labels
enhancementhelp wantedgood first issueno auto closehacktoberfest
assignees[]
createdAtJul 7, 2025, 1:20 PM
updatedAtOct 8, 2025, 11:41 AM
githubUrlhttps://github.com/neomjs/neo/issues/6972
authortobiu
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]

Enhance createHierarchicalDataProxy to Support Reactive Non-Leaf Nodes

Openenhancementhelp wantedgood first issueno auto closehacktoberfest
tobiu
tobiu commented on Jul 7, 2025, 1:20 PM

Description:

The current implementation of the hierarchical data proxy only creates reactive core.Config atoms for the leaf nodes of the state tree. While this approach is highly performant and granular, it has two significant limitations:

  1. Inability to Observe Sub-Trees: It is not possible to create an effect that reacts to any arbitrary change within a nested object (e.g., an effect on data.user does not re-run when data.user.name changes).
  2. Problematic Atomic Replacements: Atomically replacing an entire branch of the state (e.g., data.user = { ... }) does not work as expected, as it orphans the old Config atoms instead of triggering updates.

This feature request proposes enhancing the system to support "Full-Tree Reactivity," where every node in the state tree (both branches and leaves) is a reactive atom.

Benefits:

  • Intuitive Reactivity: Developers could subscribe to any part of the state tree, and changes would propagate as expected.
  • Powerful State Patterns: Would enable atomic sub-tree replacements and simplify state management logic.
  • Improved Developer Experience: Aligns the state manager with modern reactive principles, making it more powerful and easier to use.

Considerations:

  • This is a complex enhancement that will require careful implementation to manage performance.
  • A "notification bubbling" system will be needed to ensure changes in leaf nodes correctly trigger effects subscribed to parent nodes.

Implementing this feature would be a major step forward for the Neo.mjs state management system, providing a more robust and developer-friendly experience.

tobiu added the enhancement label on Jul 7, 2025, 1:20 PM
tobiu removed the stale label on Oct 8, 2025, 11:41 AM
tobiu added the no auto close label on Oct 8, 2025, 11:41 AM
tobiu
tobiu Oct 8, 2025, 11:41 AM

this one needs a review. might be that it is already implemented.

tobiu added the help wanted label on Oct 8, 2025, 11:41 AM
tobiu added the good first issue label on Oct 8, 2025, 11:41 AM
tobiu added the hacktoberfest label on Oct 8, 2025, 11:41 AM