LearnNewsExamplesServices
Frontmatter
id9445
titleTreeGrid Documentation: Create high-level architectural guide for TreeStore
stateClosed
labels
documentationenhancementaigrid
assigneestobiu
createdAtMar 12, 2026, 10:15 AM
updatedAtMar 12, 2026, 10:48 AM
githubUrlhttps://github.com/neomjs/neo/issues/9445
authortobiu
commentsCount2
parentIssue9404
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 12, 2026, 10:16 AM

TreeGrid Documentation: Create high-level architectural guide for TreeStore

Closed v12.1.0 documentationenhancementaigrid
tobiu
tobiu commented on Mar 12, 2026, 10:15 AM

Goal

Create a comprehensive, high-level architectural guide for the new Neo.data.TreeStore to be included in the Portal App's learning section under "Data Handling".

Details

The guide needs to explain the complex, multi-threaded architecture of the Neo.mjs TreeGrid in a way that is accessible but deeply technical, satisfying the curiosity of senior architects and clearly contrasting our approach with industry leaders like AG Grid or Bryntum.

Key concepts to cover:

  1. The "Heavy OOP" Trap: Explain why traditional ORM models (instantiating heavy Model classes for every node) fail at scale and cause Garbage Collection pauses.
  2. The RecordFactory Advantage: Detail how Neo.mjs uses a single Model instance and dynamically generates lightweight Record prototypes, encapsulating raw JSON behind a Symbol for zero-overhead property access.
  3. The Dual-Layer Architecture:
    • Structural Layer: Deep, hierarchical maps (#childrenMap, #allRecordsMap) for O(1) data access.
    • Projection Layer: The flat _items array that UI virtual scrollers actually bind to.
  4. WAI-ARIA Trade-offs: Explain why maintaining siblingCount and siblingIndex directly on the record (paying an O(N) cost during mutation) is critical for guaranteeing O(1) read performance during 60-120fps scrolling.
  5. Reactivity Models: Contrast single-node toggle operations (firing mutate events) with highly optimized bulk operations like expandAll (silent state updates followed by a single load event).
  6. Mermaid Diagrams: Include sequence diagrams to visually explain the projection splicing and the difference between single and bulk operations. Ensure diagrams use structural styling (stroke-width, stroke-dasharray) rather than hardcoded background colors to support the Portal App's dark mode.
tobiu added the documentation label on Mar 12, 2026, 10:15 AM
tobiu added the enhancement label on Mar 12, 2026, 10:15 AM
tobiu added the ai label on Mar 12, 2026, 10:15 AM
tobiu added the grid label on Mar 12, 2026, 10:15 AM
tobiu referenced in commit b9a909f - "docs: Add high-level architectural guide for TreeStore (#9445)" on Mar 12, 2026, 10:15 AM
tobiu
tobiu Mar 12, 2026, 10:16 AM

Input from Gemini 3.1 Pro:

✦ I have drafted and committed the new TreeStore architectural guide.

The guide successfully covers:

  1. The memory and GC pitfalls of traditional ORM grids (Bryntum/ExtJS).
  2. Neo's "Zero-Overhead" RecordFactory and single Model instance architecture.
  3. The Structural vs Projection layer maps.
  4. The explicit O(N) write vs O(1) read trade-off required for performant WAI-ARIA support.
  5. Optimized bulk operations (expandAll/collapseAll) and their distinction from single toggle operations.
  6. Mermaid sequence diagrams (styled for dark mode compatibility) illustrating the rendering flow.

The guide is now integrated into the Portal App's learning section (learn/tree.json). I have pushed the commit to the dev branch.

tobiu assigned to @tobiu on Mar 12, 2026, 10:16 AM
tobiu added parent issue #9404 on Mar 12, 2026, 10:16 AM
tobiu closed this issue on Mar 12, 2026, 10:16 AM
tobiu referenced in commit 79273d9 - "docs: Fix mermaid rendering issue with '#' character in loop description (#9445)" on Mar 12, 2026, 10:23 AM
tobiu
tobiu Mar 12, 2026, 10:48 AM

Fixed mermaid rendering issue with '#' character in loop description.