LearnNewsExamplesServices
Frontmatter
id9418
titleCreate Data Normalizer Architecture (`Neo.data.normalizer.Base` & `Tree`)
stateClosed
labels
enhancementaiarchitecturecore
assigneestobiu
createdAtMar 9, 2026, 4:45 PM
updatedAtMar 12, 2026, 3:45 PM
githubUrlhttps://github.com/neomjs/neo/issues/9418
authortobiu
commentsCount1
parentIssue9449
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 12, 2026, 3:45 PM

Create Data Normalizer Architecture (Neo.data.normalizer.Base & Tree)

Closed v12.1.0 enhancementaiarchitecturecore
tobiu
tobiu commented on Mar 9, 2026, 4:45 PM

Goal

Introduce a Neo.data.normalizer.Base class and a concrete Neo.data.normalizer.Tree implementation to decouple geometric data shaping from Stores and Parsers.

Context

In our modernized data pipeline (Connection -> Parser -> Normalizer -> Store), the Normalizer is responsible for taking native JavaScript objects (yielded by a Parser) and reshaping them for the Store. For the Tree Grid epic, external APIs often return nested hierarchical data, while Neo.data.TreeStore requires a flattened 1D array with parentId relationships.

Acceptance Criteria

  • Create src/data/normalizer/Base.mjs defining the standard interface for structural normalization and metadata extraction (like totalCount).
  • Create src/data/normalizer/Tree.mjs. This normalizer must take a nested JS object array (e.g., children properties), recursively flatten it into a 1D array, and inject parentId links before passing the data to the TreeStore.
  • Update Store configs to accept a normalizer property.
tobiu added the enhancement label on Mar 9, 2026, 4:45 PM
tobiu added the ai label on Mar 9, 2026, 4:45 PM
tobiu added the architecture label on Mar 9, 2026, 4:45 PM
tobiu added the core label on Mar 9, 2026, 4:45 PM
tobiu added parent issue #9404 on Mar 9, 2026, 4:45 PM
tobiu cross-referenced by #9420 on Mar 9, 2026, 4:46 PM
tobiu assigned to @tobiu on Mar 9, 2026, 4:46 PM
tobiu cross-referenced by #9449 on Mar 12, 2026, 3:20 PM
tobiu removed parent issue #9404 on Mar 12, 2026, 3:21 PM
tobiu added parent issue #9449 on Mar 12, 2026, 3:21 PM
tobiu referenced in commit ebeec39 - "feat: Create Data Normalizer Architecture (#9418)" on Mar 12, 2026, 3:43 PM
tobiu
tobiu Mar 12, 2026, 3:45 PM

Input from Gemini 3.1 Pro:

✦ I have implemented the new Neo.data.normalizer.Base and Neo.data.normalizer.Tree architecture as requested.

Changes Made:

  • src/data/normalizer/Base.mjs: Created the base class that defines the normalize(data) interface to handle structural reshaping and metadata extraction.
  • src/data/normalizer/Tree.mjs: Created a specific implementation that traverses hierarchical JSON structures based on a childrenProperty, flattens the tree into a 1D array, and injects parentId and isLeaf data natively. Memory optimization is also applied by removing the raw nested children arrays since the TreeStore uses #childrenMap.
  • src/data/Store.mjs: Added the normalizer_ reactive config.
  • test/playwright/unit/data/normalizer/Tree.spec.mjs: Added a test suite that successfully tests single objects, basic flattening, structural injection (isLeaf, parentId), custom configurations (childrenProperty, keyProperty), and the extraction of totalCount.

Tests executed and all 331 unit tests pass flawlessly.

The code has been committed and pushed under #9418.

tobiu closed this issue on Mar 12, 2026, 3:45 PM