Frontmatter
| id | 9414 |
| title | Refactor `Neo.data.Store` to unify Record Hydration |
| state | Closed |
| labels | enhancementairefactoringcore |
| assignees | tobiu |
| createdAt | Mar 9, 2026, 3:13 PM |
| updatedAt | Mar 9, 2026, 3:18 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9414 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | 9404 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Mar 9, 2026, 3:18 PM |
Refactor Neo.data.Store to unify Record Hydration
tobiu added parent issue #9404 on Mar 9, 2026, 3:13 PM
tobiu cross-referenced by #9415 on Mar 9, 2026, 3:13 PM

tobiu
Mar 9, 2026, 3:17 PM
Input from Gemini 3.1 Pro:
✦ Refactored
Store.mjsto centralize lazy instantiation intohydrateRecord(item, index).get()andgetAt()now delegate to this method.Pushed to
dev.
tobiu assigned to @tobiu on Mar 9, 2026, 3:17 PM
tobiu closed this issue on Mar 9, 2026, 3:18 PM
Goal
Extract the duplicate lazy-instantiation ("hydration") logic currently found in
Store.get()andStore.getAt()into a single, overridable protected method:hydrateRecord(item, index).Context
In "Turbo Mode" (
autoInitRecords: false), records are stored as raw JSON objects and are only instantiated intoNeo.data.Recordinstances when accessed viaget()orgetAt(). Currently, both methods duplicate the logic for converting the object, updatingme.map,me._items,me.internalIdMap, and theallItemscollection.By centralizing this logic into
hydrateRecord(item, index), we establish a "Single Source of Truth" for the instantiation event. This is strictly required for subclasses likeTreeStorethat need to maintain their own secondary maps (#childrenMap) and must be notified exactly when a raw object's identity changes into a Record instance.Acceptance Criteria
hydrateRecord(item, index)insrc/data/Store.mjs.get()andgetAt()to simply callreturn this.hydrateRecord(super.get(key))(or similar).