LearnNewsExamplesServices
Frontmatter
id9415
titleSupport "Turbo Mode" in `Neo.data.TreeStore`
stateClosed
labels
enhancementaiperformancecore
assigneestobiu
createdAtMar 9, 2026, 3:13 PM
updatedAtMar 9, 2026, 3:22 PM
githubUrlhttps://github.com/neomjs/neo/issues/9415
authortobiu
commentsCount2
parentIssue9404
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 9, 2026, 3:22 PM

Support "Turbo Mode" in Neo.data.TreeStore

Closed v12.1.0 enhancementaiperformancecore
tobiu
tobiu commented on Mar 9, 2026, 3:13 PM

Goal

Ensure Neo.data.TreeStore can safely operate with autoInitRecords: false ("Turbo Mode") without suffering from identity fragmentation between the main _items array and its internal tree maps.

Context

When a TreeStore ingests raw JSON data in Turbo Mode, its #childrenMap and #allRecordsMap store references to those raw objects. If the Grid accesses a node via store.get(), the base Store instantiates a Neo.data.Record. At that moment, the identity diverges: the main _items array holds the Record, but the #childrenMap still holds the raw JSON object. If the Record mutates (e.g., collapsed state changes), the #childrenMap remains unaware.

Architecture

  • Leverage the newly introduced hydrateRecord method from the parent Store (see dependency).
  • Override hydrateRecord(item, index) in TreeStore.mjs.
  • Call super.hydrateRecord(item, index).
  • If the method converted a raw object into a Record, find the old raw object in #allRecordsMap and #childrenMap and replace it with the new Record instance.

Dependencies

  • Depends on the Store refactoring sub-task (#9414).
tobiu added the enhancement label on Mar 9, 2026, 3:13 PM
tobiu added the ai label on Mar 9, 2026, 3:13 PM
tobiu added the performance label on Mar 9, 2026, 3:13 PM
tobiu added the core label on Mar 9, 2026, 3:13 PM
tobiu added parent issue #9404 on Mar 9, 2026, 3:14 PM
tobiu referenced in commit a7778a2 - "feat: Support Turbo Mode in TreeStore (#9415) on Mar 9, 2026, 3:21 PM
tobiu
tobiu Mar 9, 2026, 3:22 PM

Input from Gemini 3.1 Pro:

✦ Implemented Turbo Mode support for TreeStore.

  • Overrides the newly centralized hydrateRecord method from the base Store.
  • Intercepts lazy instantiation events to "heal" #allRecordsMap and #childrenMap, ensuring they always maintain the unified Record identity instead of diverging with raw object references.

Changes pushed to dev.

tobiu assigned to @tobiu on Mar 9, 2026, 3:22 PM
tobiu
tobiu Mar 9, 2026, 3:22 PM

Implemented Turbo Mode support for TreeStore. Pushed to dev.

tobiu closed this issue on Mar 9, 2026, 3:22 PM